import type { ReleasePreview } from '../types.js' import Cover from '../components/Cover.js' export default function ConfirmView({ code, preview, matchAlbumId, onSetMatch, onClearMatch, onAdd, adding, addError, }: { code: string | null preview: ReleasePreview matchAlbumId: number | null onSetMatch: (albumId: number) => void onClearMatch: () => void onAdd: () => void adding: boolean addError: string | null }) { const { release, duplicate, ripMatch, matchCandidates } = preview return (

{release.title}

{release.artist}

{[release.year, release.formats.join(', '), release.labels[0], release.catno] .filter(Boolean) .join(' · ')}

{code &&

Barcode {code}

}
{ripMatch === 'ripped' && (

In your digital collection ✓

)} {ripMatch === 'not_ripped' && (

Not ripped yet

)} {ripMatch === 'ambiguous' && (
Possible matches in your library — which one is it?
{matchCandidates.map((m) => ( ))}
)} {duplicate && (

Heads up: this release is already in your collection.

)}
Tracklist
    {release.tracklist.map((t, i) => (
  1. {t.position} {t.title}
  2. ))}
{addError &&

{addError}

}
) }