import React from "react"; import { motion } from "framer-motion"; import { Upload, Search, Check, ArrowRight } from "lucide-react"; import { Card, Button } from "@/components/common"; import Header from "@/components/sections/Header"; import CVUpload from "@/components/sections/CVUpload"; import { AutoApplyProfile } from "@/components/sections/AutoApplyProfile"; import JobSearch from "@/components/sections/JobSearch"; import { useJobStore } from "@/store/appStore"; type StepValue = "upload" | "search" | "review"; interface WorkflowPageProps { onJobsFound?: () => void; onSettingsClick?: () => void; onHomeClick?: () => void; } const WorkflowPage: React.FC = ({ onJobsFound, onSettingsClick, onHomeClick, }) => { const [currentStep, setCurrentStep] = React.useState("upload"); const { cvTemplate, jobs } = useJobStore(); const steps = [ { value: "upload" as StepValue, label: "Upload CV", icon: Upload, completed: !!cvTemplate, }, { value: "search" as StepValue, label: "Search Jobs", icon: Search, completed: jobs.length > 0, }, { value: "review" as StepValue, label: "Review & Generate", icon: Check, completed: false, }, ]; return (
{/* Progress Steps */}
{steps.map((step, index) => ( setCurrentStep(step.value)} className={`flex flex-col items-center gap-2 cursor-pointer transition-all ${ currentStep === step.value ? "opacity-100" : "opacity-60 hover:opacity-80" }`} >
{step.completed && currentStep !== step.value ? ( ) : ( )}
{step.label}
{index < steps.length - 1 && (
)}
))}
{/* Content */} {currentStep === "upload" && ( //
// //

// Upload Your CV //

//

// Start by uploading your base CV template. We'll use this to // create tailored versions for each job. //

// { // // Auto-proceed to next step // setTimeout(() => { // setCurrentStep('search'); // }, 500); // }} // onError={() => { // // Stay on current step on error // }} // /> //
// {cvTemplate && ( // // // // )} //
{" "} {/* Added spacing container */}

Upload Your CV

Start by uploading your base CV template. We'll use this to create tailored versions for each job.

{ // REMOVED the setTimeout auto-proceed! // We want the user to stay here so they can optionally setup Auto-Apply. console.log("CV Uploaded Successfully"); }} onError={() => { // Stay on current step on error }} />
{/* --- NEW OPTIONAL AUTO-APPLY SECTION --- */} {/* PROCEED BUTTON */} {cvTemplate && ( )}
)} {currentStep === "search" && (

Search for Jobs

Find job opportunities that match your skills and interests.

{ onJobsFound?.(); // Auto-proceed to next step after small delay setTimeout(() => { setCurrentStep("review"); }, 800); }} />
)} {currentStep === "review" && (

Ready to Generate CVs

You have {jobs.length} jobs ready. Select the ones you want to generate tailored CVs for and download them all at once.

{jobs.length > 0 ? ( ) : (

No jobs found. Please try searching again.

)}
)}
); }; export default WorkflowPage;