diff --git a/apps/fabro-web/app/components/steer-bar.tsx b/apps/fabro-web/app/components/steer-bar.tsx new file mode 100644 index 000000000..f5a5805eb --- /dev/null +++ b/apps/fabro-web/app/components/steer-bar.tsx @@ -0,0 +1,58 @@ +import { useState, type FormEvent, type KeyboardEvent } from "react"; + +export interface SteerBarProps { + runId: string; +} + +export function SteerBar({ runId: _runId }: SteerBarProps) { + const [text, setText] = useState(""); + const trimmed = text.trim(); + const canSubmit = trimmed.length > 0; + + function handleSubmit(e: FormEvent) { + e.preventDefault(); + if (!canSubmit) return; + setText(""); + } + + function handleKeyDown(e: KeyboardEvent) { + if (e.key === "Enter" && !e.shiftKey) { + e.preventDefault(); + if (canSubmit) { + setText(""); + } + } + } + + return ( +
+
+
+
+