import { useState } from "react"; import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyTitle, Input, } from "@ace/ui"; type Props = { onCreate: (project: string) => void; dialog?: boolean; open?: boolean; onOpenChange?: (open: boolean) => void; }; const DESCRIPTION = "Channels run on this machine. Agents work in lanes: worktrees of the project's Git repository."; /** Starts a channel in a project folder, as the empty state or as a dialog. */ export function NewChannel({ onCreate, dialog, open, onOpenChange }: Props) { const [path, setPath] = useState(""); const form = (
{ event.preventDefault(); if (path.trim()) onCreate(path.trim()); }} > setPath(event.target.value)} /> {!dialog && }
); if (!dialog) { return ( Start a channel {DESCRIPTION} {form} ); } return ( Add a project {DESCRIPTION} {form} ); }