'use client'; import { useTranslations } from 'next-intl'; import { motion } from 'framer-motion'; import { Calendar, Mail } 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) { // Split on double newlines for paragraph blocks const blocks = brief.split('\n\n').filter(Boolean); return blocks.map((block, blockIdx) => { const lines = block.split('\n').filter(Boolean); // Detect a heading block (starts with **) const isSectionHeading = lines.length === 1 && lines[0].startsWith('**') && lines[0].endsWith('**'); if (isSectionHeading) { const text = lines[0].replace(/\*\*/g, ''); // Top heading is larger if (blockIdx === 0) { return (

{text}

); } return (

{text}

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

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

); })}
); }); } // ─── Cal.com Embed / Booking ────────────────────────────────────────────────── function BookingSection() { return (

Book a Consultation

30 minutes to discuss your brief with our team

Book a Call
); } // ─── Main Component ─────────────────────────────────────────────────────────── interface StepCompleteProps { formData: WizardFormData; brief: string; } export default function StepComplete({ formData, brief }: 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 && (

Your project brief

{renderBrief(brief)}
)} {/* Booking */}

{t('complete.bookTitle')}

{/* Fallback contact */}

Or reach us directly at{' '} hello@letsbe.biz

); }