import React from 'react'; import { LuCheck, LuSparkles } from 'react-icons/lu'; import { resolveSetupStep } from '../../service/copilot/setup-steps'; import type { ICopilotQuestOverview, ICopilotSetupStep, } from '../../service/copilot/copilot.interface'; import { cn } from './cn'; import { CopilotBadges } from './CopilotBadges'; /** Quick prompts shown under the home surface. */ const SUGGESTION_CHIPS: readonly string[] = [ 'What is my AI Readiness score?', 'What does AI Visibility do?', ]; /** * The copilot home surface (shown on an empty thread): a proactive setup * tutorial when onboarding is incomplete, today's quests with points, and a * couple of quick prompts. * * @param props - Component props. * @param props.setupSteps - All setup steps with completion state. * @param props.questOverview - Quests, points, history. * @param props.onAsk - Send a chat message. * @return The home surface. */ export function CopilotHome({ setupSteps, questOverview, onAsk, }: { setupSteps: ICopilotSetupStep[]; questOverview: ICopilotQuestOverview | null; onAsk: (text: string) => void; }): React.ReactElement { const openQuests = questOverview?.open ?? []; const earnedPoints: number = questOverview?.earned_points ?? 0; const resolvedCount: number = questOverview?.resolved_count ?? 0; const setupIncomplete: boolean = setupSteps.some(step => !step.completed); // The single most impactful open quest, surfaced as a proactive banner once // onboarding is done (during setup the checklist takes priority). const nudge = questOverview?.nudge ?? null; return (

Hi, I'm Recomaze Co-pilot.{' '} {setupIncomplete ? "Let's finish setting up Recomaze, step by step. I can do parts for you." : "Here's what we can work on today."}

{nudge && !setupIncomplete && ( )} {setupSteps.length > 0 && (

Finish your setup

{setupSteps.map((setupStep: ICopilotSetupStep, index: number) => { const step = resolveSetupStep(setupStep.name); return ( ); })}
)} {openQuests.length > 0 && (

Today's tasks

{earnedPoints} pts ยท {resolvedCount} done
{openQuests.map(quest => ( ))}
)}
{SUGGESTION_CHIPS.map((chip: string) => ( ))}
); }