import "./components/ui/tidal.css"; import { useState } from "react"; import { TidalDeploymentPipeline, type TidalDeploymentStage } from "./components/ui/deployment-pipeline"; import "./components/ui/deployment-pipeline.css"; import "./components/ui/status-badge.css"; const tidalExampleStyles = ".tidal-scope .deployment-pipeline-demo {\n width: 100%;\n max-width: 760px;\n min-width: 0;\n}"; export function DeploymentPipelineDemo() { const [phase, setPhase] = useState<"failed" | "approval" | "ready">("failed"); const stages: TidalDeploymentStage[] = [ { id: "build", label: "Build artifact", state: "passed", timing: "42 seconds", description: "Example artifact: app-v1.8.0.zip", }, { id: "checks", label: "Release checks", state: phase === "failed" ? "failed" : "passed", checks: [ { id: "types", label: "Type checks", state: "passed" }, { id: "smoke", label: "Preview smoke test", state: phase === "failed" ? "failed" : "passed", detail: phase === "failed" ? "Sample failure: preview did not respond." : "Sample preview check passed.", }, ], actions: phase === "failed" ? [ { id: "retry", label: "Retry sample check", onRequest: () => setPhase("approval"), }, ] : undefined, }, { id: "approval", label: "Production approval", state: phase === "failed" ? "queued" : phase === "approval" ? "awaiting-approval" : "passed", description: phase === "approval" ? "Review the artifact before continuing." : undefined, actions: phase === "approval" ? [ { id: "approve", label: "Approve sample release", onRequest: () => setPhase("ready"), }, ] : undefined, }, { id: "release", label: "Production release", state: phase === "ready" ? "passed" : "queued", description: phase === "ready" ? "The local sample flow is complete." : "Waiting for the preceding stages.", }, ]; return (