import type { Series } from '@/types/nostr'
import { SeriesCard } from './SeriesCard'

interface SeriesListProps {
  series: Series[]
  onSelect: (seriesId: string | undefined) => void
  selectedId?: string | undefined
}

export function SeriesList({ series, onSelect, selectedId }: SeriesListProps) {
  if (series.length === 0) {
    return <p className="text-sm text-gray-600">Aucune série pour cet auteur.</p>
  }
  return (
    <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
      {series.map((s) => (
        <SeriesCard key={s.id} series={s} onSelect={onSelect} selected={s.id === selectedId} />
      ))}
    </div>
  )
}
