import Link from 'next/link' import { useState } from 'react' import { CreateSeriesModal } from '@/components/CreateSeriesModal' import { SeriesCard } from '@/components/SeriesCard' import { Button, Card, EmptyState } from '@/components/ui' import { useNostrAuth } from '@/hooks/useNostrAuth' import { t } from '@/lib/i18n' import type { Series } from '@/types/nostr' export function SeriesList(params: { series: Series[]; authorPubkey: string; onSeriesCreated: () => void }): React.ReactElement { const { pubkey, isUnlocked } = useNostrAuth() const [showCreateModal, setShowCreateModal] = useState(false) const isAuthor = pubkey === params.authorPubkey && isUnlocked return (
setShowCreateModal(true)} /> setShowCreateModal(false)} onSuccess={params.onSeriesCreated} authorPubkey={params.authorPubkey} />
) } function SeriesListHeader(params: { isAuthor: boolean; onCreate: () => void }): React.ReactElement { return (

{t('series.title')}

{params.isAuthor && ( )}
) } function SeriesGrid(params: { series: Series[] }): React.ReactElement { if (params.series.length === 0) { return ( ) } return (
{params.series.map((s) => ( {}} /> ))}
) }