import { useState } from 'react' import * as m from 'paraglide/messages' import clsx from 'clsx' interface Props { discs: { number: number | null body: string | null }[] } export default function TrackList(props: Props) { const { discs = [] } = props const [current, setCurrent] = useState(0) return (
{discs.length > 1 ? discs.map(({ number }, i) => (
)) : null}
{discs.length > 0 && discs[current].body?.split('\n').map((track, i) => ( ))}
{i + 1} {track}
) }