import { useState } from 'react' import Link from 'next/link' import { SeriesSection } from './SeriesSection' import { CreateSeriesModal } from './CreateSeriesModal' import { useNostrAuth } from '@/hooks/useNostrAuth' import { t } from '@/lib/i18n' interface ProfileSeriesBlockProps { currentPubkey: string onSelectSeries: (seriesId: string | undefined) => void selectedSeriesId?: string | undefined } export function ProfileSeriesBlock({ currentPubkey, onSelectSeries, selectedSeriesId }: ProfileSeriesBlockProps): React.ReactElement { const { pubkey, isUnlocked } = useNostrAuth() const [showCreateModal, setShowCreateModal] = useState(false) const [refreshKey, setRefreshKey] = useState(0) const isAuthor = pubkey !== null && pubkey === currentPubkey && isUnlocked const handleSeriesCreated = (): void => { setRefreshKey((prev) => prev + 1) } return (
setShowCreateModal(true)} /> {selectedSeriesId && (
Ouvrir la page de la série sélectionnée
)} { setShowCreateModal(false) }} onSuccess={handleSeriesCreated} authorPubkey={currentPubkey} />
) } function ProfileSeriesHeader({ isAuthor, onCreate }: { isAuthor: boolean; onCreate: () => void }): React.ReactElement { return (

Séries

{isAuthor && ( )}
) }