'use client'; import { FunctionComponent, ReactNode } from 'react'; import { useTranslations } from 'next-intl'; import { Paper, Stack, Typography } from '@mui/material'; import Money from '@/components/common/Money'; import type { MoneyTone } from '@/components/common/Money'; import type { BookingViewerRole } from '@/services/bookings/types'; export interface BookingMoneySummaryProps { /** IRR digit-strings; `gross = commission + payout`, guaranteed server-side. **Never** summed/re-split here. */ grossPriceIrr: string; balinyaarCommissionIrr: string; nursePayoutAmount: string; /** Drives the payout row label (nurse sees «درآمد شما»; customer sees «سهم پرستار»). */ viewerRole: BookingViewerRole; } /** * The confirmed booking money summary: service cost / Balinyaar fee (کارمزد) / nurse payout — each * rendered exactly as the server sent it (IRR digit-strings) through the money util as grouped Toman. * **Display-only:** no client-side sum, derive, or re-split; the tax line + escrow notice are the * checkout surface (deferred to f9). The payout row label adapts to the viewer. * @component BookingMoneySummary */ const BookingMoneySummary: FunctionComponent = ({ grossPriceIrr, balinyaarCommissionIrr, nursePayoutAmount, viewerRole, }) => { const t = useTranslations('booking'); return ( {t('money_title')} ); }; function MoneyRow({ label, amountIrr, tone, deduction = false, }: { label: string; amountIrr: string; tone?: MoneyTone; deduction?: boolean; }): ReactNode { return ( {label} ); } export default BookingMoneySummary;