"use client"; import { useState } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { Dna, ArrowRight, LoaderCircle, FileText, CircleCheck, Circle } from "lucide-react"; import { PipelineResults } from "@/components/results/PipelineResults"; type WizardStep = "input" | "running"; const ALL_STEPS = [ { id: "blast", label: "BLAST & UniProt", essential: true }, { id: "msa", label: "Multiple Sequence Alignment", essential: false }, { id: "phylo", label: "Phylogenetic Tree", essential: false }, { id: "domains", label: "Domain Architecture", essential: false }, { id: "interpret",label: "AI Interpretation", essential: true }, ]; export function AnalysisWizard() { const [currentStep, setCurrentStep] = useState("input"); const [sequence, setSequence] = useState(""); const [jobId, setJobId] = useState(null); const [enabledSteps, setEnabledSteps] = useState( ALL_STEPS.filter(s => s.essential).map(s => s.id) ); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); const [done, setDone] = useState(false); function toggleStep(id: string) { setEnabledSteps(prev => prev.includes(id) ? prev.filter(s => s !== id) : [...prev, id] ); } async function handleSubmit() { if (!sequence.trim()) { setError("Paste a protein sequence first."); return; } setLoading(true); setError(null); try { const res = await fetch("/api/backend/api/pipeline/v2/run", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ sequence: sequence.trim(), steps: enabledSteps }), }); if (!res.ok) throw new Error((await res.json()).detail || "Submit failed"); const data = await res.json(); setJobId(data.job_id); setCurrentStep("running"); } catch (e: any) { setError(e.message); } finally { setLoading(false); } } return (
{currentStep === "running" ? : } Sequence Input
{done ? : currentStep === "running" ? : } Results
{currentStep === "input" ? (

Paste Your Sequence

FASTA or raw amino acid sequence. Choose which analyses to run.

{DEMOS.map(({ label, seq }) => ( ))}