diff --git a/web/app/workflows/[id]/page.tsx b/web/app/workflows/[id]/page.tsx index de5c2f6..0ddfcc4 100644 --- a/web/app/workflows/[id]/page.tsx +++ b/web/app/workflows/[id]/page.tsx @@ -3,468 +3,375 @@ import { useEffect, useState } from "react"; import { useParams, useRouter } from "next/navigation"; import { useQuery, useQueryClient } from "@tanstack/react-query"; -import { - api, - Workflow, - WorkflowStep, - WorkflowStepRef, - SecretGroupSummary, -} from "@/lib/api"; +import { api, Workflow, WorkflowStep, WorkflowStepRef, SecretGroupSummary } from "@/lib/api"; import { Button, Card } from "@/components/ui"; const inputClass = - "w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder-text-secondary/50 focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent"; + "w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder-text-secondary/50 focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent"; function NewStepForm({ onClose }: { onClose: () => void }) { - const queryClient = useQueryClient(); - const [name, setName] = useState(""); - const [interpreter, setInterpreter] = useState<"bash" | "powershell">("bash"); - const [script, setScript] = useState(""); - const [saving, setSaving] = useState(false); - const [error, setError] = useState(null); + const queryClient = useQueryClient(); + const [name, setName] = useState(""); + const [interpreter, setInterpreter] = useState<"bash" | "powershell">("bash"); + const [script, setScript] = useState(""); + const [saving, setSaving] = useState(false); + const [error, setError] = useState(null); - const create = async () => { - setSaving(true); - setError(null); - try { - await api.createStep({ - name: name.trim(), - description: "", - interpreter, - script, - declared_outputs: [], - secret_refs: [], - }); - queryClient.invalidateQueries({ queryKey: ["steps"] }); - onClose(); - } catch (e) { - setError((e as Error).message); - } finally { - setSaving(false); - } - }; + const create = async () => { + setSaving(true); + setError(null); + try { + await api.createStep({ + name: name.trim(), + description: "", + interpreter, + script, + declared_outputs: [], + secret_refs: [], + }); + queryClient.invalidateQueries({ queryKey: ["steps"] }); + onClose(); + } catch (e) { + setError((e as Error).message); + } finally { + setSaving(false); + } + }; - return ( -
- {error &&
{error}
} - setName(e.target.value)} - /> - -