'use client'; import type { TokenInfo } from '@/lib/payment'; import { formatWeiToETH } from '@/lib/wallet'; /* ── Props ── */ interface OverviewProps { totalUploads: bigint; tokens: TokenInfo[]; revenues: Record; contractBalance: Record; contractAddress: string; owner: string | null; isOwner: boolean; address: string | null; deployed: boolean; onNavigate: (view: string) => void; } /* ════════════════════════════ Component ════════════════════════════ */ export default function Overview({ totalUploads, tokens, revenues, contractBalance, contractAddress, owner, isOwner, address, deployed, onNavigate, }: OverviewProps) { return (
{/* Stats grid */}
Total Uploads
{totalUploads.toString()}
{tokens.filter(t => t.enabled).map(tk => { const rev = revenues[tk.symbol] || BigInt(0); const bal = contractBalance[tk.symbol]; return (
{tk.symbol} Revenue
{tk.symbol === 'ETH' ? formatWeiToETH(rev, 6) : rev.toString()}
{bal && (
Balance: {tk.symbol === 'ETH' ? formatWeiToETH(bal, 6) : bal} {tk.symbol}
)}
); })}
{/* Contract info */}

Contract

Address {contractAddress.slice(0, 10)}...
Owner {owner ? `${owner.slice(0, 8)}...${owner.slice(-6)}` : '-'} {isOwner && }
Deployed {deployed ? 'Yes' : 'No'}
Connected {address ? `${address.slice(0, 6)}...${address.slice(-4)}` : '-'}
{/* If owner — quick actions */} {isOwner && (

Quick Actions

)}
); }