import { For, Show } from 'solid-js' import { FinanceSummaryCards } from '../components/finance/finance-summary-cards' import { FinanceVisuals } from '../components/finance/finance-visuals' import { MemberBalanceCard } from '../components/finance/member-balance-card' import type { MiniAppDashboard } from '../miniapp-api' type Props = { copy: Record dashboard: MiniAppDashboard | null currentMemberLine: MiniAppDashboard['members'][number] | null utilityTotalMajor: string purchaseTotalMajor: string memberBalanceVisuals: { member: MiniAppDashboard['members'][number] totalMinor: bigint barWidthPercent: number segments: { key: string label: string amountMajor: string amountMinor: bigint widthPercent: number }[] }[] purchaseChart: { totalMajor: string slices: { key: string label: string amountMajor: string color: string percentage: number dasharray: string dashoffset: string }[] } memberBaseDueMajor: (member: MiniAppDashboard['members'][number]) => string memberRemainingClass: (member: MiniAppDashboard['members'][number]) => string } export function BalancesScreen(props: Props) { return (

{props.copy.emptyDashboard ?? ''}

} > {(dashboard) => (
{(member) => ( )}
{props.copy.houseSnapshotTitle ?? ''} {dashboard().period}

{props.copy.houseSnapshotBody ?? ''}

{props.copy.householdBalancesTitle ?? ''} {String(dashboard().members.length)}

{props.copy.householdBalancesBody ?? ''}

{(member) => (
{member.displayName} {member.remainingMajor} {dashboard().currency}

{props.copy.baseDue ?? ''}: {props.memberBaseDueMajor(member)}{' '} {dashboard().currency}

{props.copy.shareRent ?? ''}: {member.rentShareMajor} {dashboard().currency}

{props.copy.shareUtilities ?? ''}: {member.utilityShareMajor}{' '} {dashboard().currency}

{props.copy.shareOffset ?? ''}: {member.purchaseOffsetMajor}{' '} {dashboard().currency}

{props.copy.paidLabel ?? ''}: {member.paidMajor} {dashboard().currency}

{props.copy.remainingLabel ?? ''}: {member.remainingMajor} {dashboard().currency}

)}
)}
) }