import type { ProfileView, CourseView } from '../types';
import React, { useState } from 'react';
import { Lock, Video, Camera, MessageSquare, ScanLine, XCircle, CheckCircle2, ShieldCheck, Award, Eye, ArrowRight } from 'lucide-react';
import { cn } from '@/lib/utils';
import { Button, Spinner, Surface } from '@/components/ds';
import { isUnlocked } from '@/lib/provingGround';
import { useSubmitChallenge, useVerifyEvidence } from '@/lib/krowHooks';
import RoleplayChallenge from './RoleplayChallenge';
import MediaChallenge from './MediaChallenge';
import VideoRecorder from './VideoRecorder';
import HazardIdentifier from './HazardIdentifier';
import OwliverAvatar from '@/components/krow/OwliverAvatar';
import { useTranslation } from 'react-i18next';
/**
* The challenge itself: learn, demonstrate, verify, proof.
*
* Presentation only — every step, transition and mutation below is the original
* flow. Styling comes from the design system so the runner reads as part of the
* Forge workspace it is embedded in rather than a widget dropped into it.
*/
const STEPS = ['Learn', 'Demonstrate', 'Verify', 'Proof'];
const TYPE_ICON = { roleplay: MessageSquare, photo: Camera, video: Video, photo_identify: ScanLine };
const TYPE_LABEL = { roleplay: 'Chat with Owliver', photo: 'Photo Proof', video: 'Record Yourself', photo_identify: 'Identify Hazards' };
/** Props for the local `Stepper` helper in this file. Optional throughout:
the JavaScript validated none of them and callers omit freely. */
interface StepperProps {
active?: any;
}
function Stepper({ active }: StepperProps) {
return (
{STEPS.map((s, i) => {
const done = i < active;
const cur = i === active;
return (
);
}
// 1 — Demonstrate
if (step === 1) {
return (
{/* The roleplay widget opens with this same prompt as its first message,
so repeating it above the transcript would say it twice. */}
{type !== 'roleplay' && (