import { useRouter } from 'next/router' import Image from 'next/image' import type { Article } from '@/types/nostr' import { Card } from './ui' import { t } from '@/lib/i18n' interface AuthorCardProps { presentation: Article } export function AuthorCard({ presentation }: AuthorCardProps): React.ReactElement { const router = useRouter() const authorName = presentation.title.replace(/^Présentation de /, '') || t('common.author') const totalBTC = (presentation.totalSponsoring ?? 0) / 100_000_000 const handleClick = (): void => { void router.push(`/author/${presentation.pubkey}`) } return (
{presentation.bannerUrl && (
{authorName}
)}

{authorName}

{presentation.preview}

{presentation.totalSponsoring !== undefined && presentation.totalSponsoring > 0 && (
{t('author.sponsoring.total', { amount: totalBTC.toFixed(6) })} BTC
)}
) }