import './index.css'; import { Coins, X } from 'lucide-react'; import { useId } from 'react'; import type { ProfileWalletLedgerResponse } from '../../contracts/runtime'; import { buildWalletLedgerPresentation } from './model'; export type PlatformProfileWalletLedgerModalProps = { ledger: ProfileWalletLedgerResponse | null; fallbackBalance: number; isLoading: boolean; error: string | null; onClose: () => void; onRetry: () => void; }; export function PlatformProfileWalletLedgerModal({ ledger, fallbackBalance, isLoading, error, onClose, onRetry, }: PlatformProfileWalletLedgerModalProps) { const titleId = useId(); const presentation = buildWalletLedgerPresentation(ledger, fallbackBalance); return (
LEDGER

泥点账单

{error ? (
{error}
) : isLoading ? (
{Array.from({ length: 5 }).map((_, index) => (
))}
) : presentation.entries.length === 0 ? (
暂无账单记录
) : (
{presentation.entries.map((entry) => (
{entry.sourceLabel}
{entry.createdAtLabel}
{entry.amountLabel}
{entry.balanceLabel}
))}
)}
); }