import { formatAmount } from '@/lib/lightning' import lightning, { TRecentSupporter } from '@/services/lightning.service' import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import UserAvatar from '../UserAvatar' import Username from '../Username' export default function RecentSupporters() { const { t } = useTranslation() const [supporters, setSupporters] = useState([]) useEffect(() => { const init = async () => { const items = await lightning.fetchRecentSupporters() setSupporters(items) } init() }, []) if (!supporters.length) return null return (
{t('Recent Supporters')}
{supporters.map((item, index) => (
{item.comment}
{formatAmount(item.amount)} {t('sats')}
))}
) }