// Create-project dialog for the rail. The API still calls these channels; // the rail presents the user-facing organizational concept. // creation feels like every other lightweight naming flow. import { Loader2Icon } from "lucide-react"; import { Button } from "../../../ui/button"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "../../../ui/dialog"; import { Input } from "../../../ui/input"; import { Label } from "../../../ui/label"; export const CHANNEL_NAME_MAX_LENGTH = 80; export function ChannelCreateDialog(props: { open: boolean; mode?: "create" | "rename" | undefined; name: string; busy: boolean; onNameChange: (name: string) => void; onOpenChange: (open: boolean) => void; onSubmit: () => void; }) { return ( { if (!props.busy) props.onOpenChange(open); }} >
{ event.preventDefault(); if (!props.busy && props.name.trim()) props.onSubmit(); }} > {props.mode === "rename" ? "Rename project" : "New project"} Projects keep related sessions together for everyone in this workspace.
props.onNameChange(event.target.value)} />
); }