"use client"; import { useState, useEffect } from "react"; import type { IngestResult, LogicTransformResult } from "@/lib/schemas/blueprint"; import type { UiManifestResult } from "@/lib/schemas/ui-manifest"; import type { AcademyPackage } from "@/lib/schemas/academy"; type TabId = "blueprint" | "logic" | "ui" | "academy"; type Props = { blueprint: IngestResult; logic: LogicTransformResult | null; ui: UiManifestResult | null; academy: AcademyPackage | null; externalTab?: TabId; }; const ASSET_COLORS: Record = { video: "border-violet-500/40 text-violet-300", audio: "border-cyan-500/40 text-cyan-300", image: "border-emerald-500/40 text-emerald-300", document: "border-amber-500/40 text-amber-300", log: "border-slate-500/40 text-slate-400" }; const ENTITY_COLORS: Record = { asset: "border-violet-500/30 bg-violet-500/10 text-violet-300", workflow: "border-cyan-500/30 bg-cyan-500/10 text-cyan-300", risk: "border-red-500/30 bg-red-500/10 text-red-300", action: "border-emerald-500/30 bg-emerald-500/10 text-emerald-300" }; export function PipelineResults({ blueprint, logic, ui, academy, externalTab }: Props) { const [activeTab, setActiveTab] = useState("blueprint"); // Sync tab when the nav sidebar selects a different agent view useEffect(() => { if (externalTab) setActiveTab(externalTab); }, [externalTab]); const tabs: Array<{ id: TabId; label: string; ready: boolean }> = [ { id: "blueprint", label: "Blueprint", ready: true }, { id: "logic", label: "Logic Plan", ready: logic !== null }, { id: "ui", label: "UI Spec", ready: ui !== null }, { id: "academy", label: "Academy", ready: academy !== null } ]; return (
{/* Tab bar */}
{tabs.map((tab) => ( ))}
{/* Scrollable content */}
{/* ── Blueprint ── */} {activeTab === "blueprint" && (

{blueprint.title}

{blueprint.summary}

{blueprint.assets.length > 0 && (

Assets

{blueprint.assets.map((a) => ( {a.title} ))}
)} {blueprint.workflow.length > 0 && (

Workflow

    {blueprint.workflow.map((step, i) => (
  1. {i + 1}

    {step.label}

    {step.intent}

  2. ))}
)} {blueprint.riskFlags.length > 0 && (

Risk Flags

{blueprint.riskFlags.map((flag, i) => (
{flag}
))}
)}
)} {/* ── Logic Plan ── */} {activeTab === "logic" && logic !== null && (

{logic.reasoningSummary}

{logic.executionPlan.length > 0 && (

Execution Plan

    {logic.executionPlan.map((s) => (
  1. {s.step} {s.title}

    {s.action}

    → {s.expectedOutcome}

  2. ))}
)} {logic.entities.length > 0 && (

Entities

{logic.entities.map((e) => ( {e.label} ))}
)} {logic.warnings.length > 0 && (

Warnings

{logic.warnings.map((w, i) => (
{w}
))}
)}
)} {/* ── UI Spec ── */} {activeTab === "ui" && ui !== null && (

Visual Direction

{ui.visualDirection}

{ui.components.length > 0 && (

Components

{ui.components.map((c) => (

{c.name}

{c.purpose}

))}
)} {ui.interactions.length > 0 && (

Interaction Patterns

    {ui.interactions.map((item, i) => (
  • · {item}
  • ))}
)} {ui.accessibilityNotes.length > 0 && (

Accessibility

    {ui.accessibilityNotes.map((note, i) => (
  • {note}
  • ))}
)}
)} {/* ── Academy ── */} {activeTab === "academy" && academy !== null && (
{/* Header */}

{academy.academyName}

{academy.tagline}

{academy.targetAudience}

{/* Landing page */}

Landing Page

{academy.landingPage.headline}

{academy.landingPage.subheadline}

{academy.landingPage.problemStatement}

{academy.landingPage.features.map((f, i) => ( {f.title} ))}

→ {academy.landingPage.cta}

{/* Pricing */}

Pricing

{academy.pricing.map((tier, i) => (

{tier.name}

{tier.priceUsd === 0 ? "Free" : `$${tier.priceUsd}`} {tier.priceUsd > 0 && /{tier.period}}

    {tier.features.map((f, fi) => (
  • {f}
  • ))}
))}
{/* Curriculum */}

Curriculum

{academy.curriculum.map((mod, mi) => (

{mod.moduleTitle}

{mod.moduleDescription}

    {mod.lessons.map((lesson, li) => (
  1. {li + 1} {lesson.title} {lesson.type} {lesson.durationMinutes}m
  2. ))}
))}
{/* SEO */}

SEO

{academy.seoMeta.title}

{academy.seoMeta.description}

{academy.seoMeta.keywords.map((k, i) => ( {k} ))}
{/* Onboarding */}

Onboarding Flow

    {academy.onboardingSteps.map((step, i) => (
  1. {i + 1} {step}
  2. ))}
{/* Launch button */}
)}
); }