diff --git a/src/app/groups/[groupId]/balances-list.tsx b/src/app/groups/[groupId]/balances-list.tsx new file mode 100644 index 0000000..c0cffa9 --- /dev/null +++ b/src/app/groups/[groupId]/balances-list.tsx @@ -0,0 +1,63 @@ +import { Balances } from '@/lib/balances' +import { cn } from '@/lib/utils' +import { Participant } from '@prisma/client' + +type Props = { + balances: Balances + participants: Participant[] + currency: string +} + +export function BalancesList({ balances, participants, currency }: Props) { + const maxBalance = Math.max( + ...Object.values(balances).map((b) => Math.abs(b.total)), + ) + + return ( +