import { useEffect, useState } from 'react' import { estimatePlatformFunds } from '@/lib/fundingCalculation' import { t } from '@/lib/i18n' export function FundingGauge() { const [stats, setStats] = useState(estimatePlatformFunds()) const [loading, setLoading] = useState(true) useEffect(() => { // In a real implementation, this would fetch actual data // For now, we use the estimate const loadStats = async () => { try { const fundingStats = estimatePlatformFunds() setStats(fundingStats) } catch (e) { console.error('Error loading funding stats:', e) } finally { setLoading(false) } } void loadStats() }, []) if (loading) { return (

{t('common.loading')}

) } const progressPercent = Math.min(100, stats.progressPercent) return (

{t('home.funding.title')}

{t('home.funding.current', { current: stats.totalBTC.toFixed(6) })} {t('home.funding.target', { target: stats.targetBTC.toFixed(2) })}
{progressPercent.toFixed(1)}%

{t('home.funding.progress', { percent: progressPercent.toFixed(1) })}

{t('home.funding.description')}

) }