import React from 'react'; import Box from '@mui/material/Box'; import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; import type { SxProps, Theme } from '@mui/material/styles'; import { WizardLayout } from '../../templates/WizardLayout'; import { Typography } from '../../atoms/Typography'; import { Button } from '../../atoms/Button'; // ─── Types ─────────────────────────────────────────────────────────────────── /** Next step link shown on the confirmation page */ export interface ConfirmationLink { label: string; href?: string; onClick?: () => void; } /** Props for the ConfirmationStep page component */ export interface ConfirmationStepProps { /** Whether this is a pre-planning flow (different copy) */ isPrePlanning?: boolean; /** User's email address (shown in confirmation text) */ email?: string; /** User's phone number (shown in at-need confirmation) */ phone?: string; /** Expected callback timeframe (at-need) */ callbackTimeframe?: string; /** Navigation links to next steps */ nextSteps?: ConfirmationLink[]; /** Callback for "View your plan" */ onViewPlan?: () => void; /** Navigation bar */ navigation?: React.ReactNode; /** Hide the help bar */ hideHelpBar?: boolean; /** MUI sx prop */ sx?: SxProps; } // ─── Component ─────────────────────────────────────────────────────────────── /** * Step 15 — Confirmation / Plan View for the FA arrangement wizard. * * Terminal confirmation page. Different copy for at-need vs pre-planning. * Confirming and orienting — not celebratory. * * At-need: "Your arrangement has been submitted" + callback info * Pre-planning: "Your plan has been saved" + return-anytime info * * No progress indicator. No back button. Links to post-plan flows. * * Pure presentation component — props in, callbacks out. * * Spec: documentation/steps/steps/15_view.yaml */ export const ConfirmationStep: React.FC = ({ isPrePlanning = false, email, phone, callbackTimeframe = 'within 2 hours', nextSteps = [], onViewPlan, navigation, hideHelpBar, sx, }) => { return ( {/* Success icon — muted, not celebratory */} {/* Heading */} {isPrePlanning ? 'Your plan has been saved' : 'Your arrangement has been submitted'} {/* Body text */} {isPrePlanning ? ( You can return and update it anytime. {email && ` We've sent a copy to ${email}.`} When the time comes, your family can contact us and we'll have everything ready. ) : ( A funeral arranger will call you {phone && ` on ${phone}`} {callbackTimeframe} to confirm the details. {email && ` A confirmation has been sent to ${email}.`} If you need to make changes before then, call us on{' '} 1300 000 000 . )} {/* View plan CTA */} {onViewPlan && ( )} {/* Next steps */} {nextSteps.length > 0 && ( {nextSteps.map((link) => ( ))} )} ); }; ConfirmationStep.displayName = 'ConfirmationStep'; export default ConfirmationStep;