'use client'; import { FunctionComponent } from 'react'; import Stack from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; import { AppButton, AccentCard } from '@/components/common'; import type { AccentTone } from '@/components/common'; import StatusChip from '@/components/StatusChip'; import type { StatusKind } from '@/components/StatusChip'; import type { BankAccountStatus } from '@/services/nurse/types'; const STATUS_KIND: Record = { pending: 'pending', verified: 'verified', mismatch: 'rejected', }; const STATUS_TONE: Record = { pending: 'warning', verified: 'success', mismatch: 'error', }; export interface BankStatusPanelProps { status: BankAccountStatus; /** Translated status chip / title / body for the active status. */ chipLabel: string; title: string; body: string; /** Masked IBAN (last-4), shown when present. */ ibanMasked?: string; ibanLabel?: string; bankName?: string; isPrimary?: boolean; primaryLabel?: string; /** Rendered only for the mismatch state (a friendly re-enter path). */ onReenter?: () => void; reenterLabel?: string; } /** * Renders one bank account in one of the three ownership-inquiry states — **pending**, * **verified**, **mismatch** — each visually distinct off the semantic tokens. The IBAN is * shown masked (last-4). Mismatch copy is passed in non-accusatory; the re-enter CTA is the * only action offered there. All strings are translated by the caller. * @component BankStatusPanel */ const BankStatusPanel: FunctionComponent = ({ status, chipLabel, title, body, ibanMasked, ibanLabel, bankName, isPrimary = false, primaryLabel, onReenter, reenterLabel, }) => ( {isPrimary && primaryLabel ? ( ) : null} {title} {body} {ibanMasked ? ( {ibanLabel ? ( {ibanLabel} ) : null} {ibanMasked} {bankName ? ( {bankName} ) : null} ) : null} {status === 'mismatch' && onReenter && reenterLabel ? ( {reenterLabel} ) : null} ); export default BankStatusPanel;