'use client'; import { useTranslations } from 'next-intl'; import { motion } from 'framer-motion'; import { Calendar, RotateCcw } from 'lucide-react'; import AnimatedCheckmark from '@/components/icons/AnimatedCheckmark'; import Button from '@/components/ui/Button'; import CalButton from '@/components/ui/CalButton'; import type { WizardFormData } from './WizardContainer'; // ─── Brief Renderer ────────────────────────────────────────────────────────── function renderBrief(brief: string) { const blocks = brief.split('\n\n').filter(Boolean); return blocks.map((block, blockIdx) => { const lines = block.split('\n').filter(Boolean); const isSectionHeading = lines.length === 1 && lines[0].startsWith('**') && lines[0].endsWith('**'); if (isSectionHeading) { const text = lines[0].replace(/\*\*/g, ''); if (blockIdx === 0) { return (

{text}

); } return (

{text}

); } if (lines.length === 1 && lines[0] === '---') { return
; } return (
{lines.map((line, lineIdx) => { const parts = line.split(/(\*\*[^*]+\*\*)/g); return (

0 ? 'mt-1' : ''}> {parts.map((part, pIdx) => part.startsWith('**') && part.endsWith('**') ? ( {part.slice(2, -2)} ) : ( {part} ), )}

); })}
); }); } // ─── Main Component ────────────────────────────────────────────────────────── interface StepCompleteProps { formData: WizardFormData; brief: string; onReset?: () => void; } export default function StepComplete({ formData, brief, onReset }: StepCompleteProps) { const t = useTranslations('configurator'); const displayEmail = formData.email || 'your inbox'; const containerVariants = { hidden: {}, visible: { transition: { staggerChildren: 0.12 }, }, }; const itemVariants = { hidden: { opacity: 0, y: 20 }, visible: { opacity: 1, y: 0, transition: { duration: 0.5, ease: [0.16, 1, 0.3, 1] as const }, }, }; return ( {/* Checkmark + heading */}

{t('complete.title')}

{t('complete.subtitle', { email: displayEmail })}

{/* Brief preview */} {brief && (

{t('complete.briefPreview')}

{renderBrief(brief)}
)} {/* Next step: book a call */}

{t('complete.nextStep')}

{t('complete.bookSubtitle')}

{t('complete.bookCall')}
{/* Fallback contact + reset */}

{t('complete.reachDirectly')}{' '} hello@letsbe.biz

{onReset && ( )}
); }