import { Button } from "@cv/ui"; import { useState } from "react"; import { usePlatformCapabilitiesQuery } from "@/generated/graphql"; import type { ParsedCVDataWithResolution } from "../schemas/draft.schema"; import { FileUploadStep } from "./FileUploadStep"; import { OnboardingMethodSelector } from "./OnboardingMethodSelector"; import { ReviewStep } from "./ReviewStep"; type SubStep = "select" | "file-upload" | "review"; interface Props { onComplete: () => void; onSkip: () => void; } export const ImportStep = ({ onComplete, onSkip }: Props) => { const [subStep, setSubStep] = useState("select"); const [parsedData, setParsedData] = useState(null); const { data: capabilities } = usePlatformCapabilitiesQuery(); const aiParsing = capabilities?.platformCapabilities?.aiParsing ?? false; const handleMethodSelect = (method: string) => { if (method === "manual") { onSkip(); return; } if (method === "file-upload") { setSubStep("file-upload"); } }; const handleFileParsed = (data: ParsedCVDataWithResolution) => { setParsedData(data); setSubStep("review"); }; if (subStep === "file-upload") { return (

Upload Your CV

We'll extract your work history and education automatically.

setSubStep("select")} />
); } if (subStep === "review" && parsedData) { return (
setSubStep("file-upload")} onDataChange={setParsedData} />
); } return (

Import Your Data

Jump-start your CV by importing existing data, or add everything manually in the next steps.

); };