2026-01-13 15:56:14 +01:00

50 lines
1.3 KiB
TypeScript

import { t } from '@/lib/i18n'
import type { AuthorPresentationArticle, Series } from '@/types/nostr'
import { AuthorPageHeader } from './AuthorPageHeader'
import { SponsoringSummary } from './SponsoringSummary'
import { SeriesList } from './SeriesList'
type AuthorPageContentProps = {
presentation: AuthorPresentationArticle | null
series: Series[]
totalSponsoring: number
authorPubkey: string
loading: boolean
error: string | null
onSeriesCreated: () => void
}
export function AuthorPageContent({
presentation,
series,
totalSponsoring,
authorPubkey,
loading,
error,
onSeriesCreated,
}: AuthorPageContentProps): React.ReactElement {
if (loading) {
return <p className="text-cyber-accent">{t('common.loading')}</p>
}
if (error) {
return <p className="text-red-400">{error}</p>
}
if (!presentation) {
return (
<div className="bg-cyber-dark/50 border border-neon-cyan/20 rounded-lg p-6">
<p className="text-cyber-accent">{t('author.notFound')}</p>
</div>
)
}
return (
<>
<AuthorPageHeader presentation={presentation} />
<SponsoringSummary totalSponsoring={totalSponsoring} author={presentation} onSponsor={onSeriesCreated} />
<SeriesList series={series} authorPubkey={authorPubkey} onSeriesCreated={onSeriesCreated} />
</>
)
}