import { type Workspace } from "../../services/api"; import { AppFormDialog, dialogPrimaryButtonClass, dialogSecondaryButtonClass, } from "~/components/common/AppFormDialog"; import { Button } from "~/components/ui/button"; import { Input } from "~/components/ui/input"; import { Textarea } from "~/components/ui/textarea"; import { formFieldClass, modalFormClass, } from "../platform/modalUi"; const FORM_INPUT_CLASS = "h-[39px] w-full rounded-md border border-[#d6e0e9] bg-white px-[11px] text-xs text-[#283a4e] outline-none focus:border-[#5b9ddb] focus:ring-3 focus:ring-brand/10 disabled:cursor-not-allowed disabled:opacity-50"; const FORM_TEXTAREA_CLASS = "min-h-[92px] w-full resize-y rounded-md border border-[#d6e0e9] bg-white px-[11px] py-2.5 text-xs leading-[1.55] text-[#283a4e] outline-none focus:border-[#5b9ddb] focus:ring-3 focus:ring-brand/10"; export function ProjectEditDialog({ open, editingProject, projectForm, saving, onChangeForm, onSubmit, onClose, }: { open: boolean; editingProject: Workspace | null; projectForm: { workspace_code: string; workspace_name: string; quota_bytes: number; description: string }; saving: boolean; onNotify: (notice: { tone: "success" | "error" | "info"; message: string }) => void; onChangeForm: (next: { workspace_code: string; workspace_name: string; quota_bytes: number; description: string }) => void; onSubmit: (event: React.FormEvent) => Promise | void; onClose: () => void; }) { return ( { if (!nextOpen) onClose(); }} eyebrow="PROJECT" title={editingProject ? "编辑项目" : "新建项目"} >
void onSubmit(event)}> {!editingProject && ( )}