/** * `` — name-input dialog for the "Rename existing cache" flow. * * Architecture §9.8 / UX §5.2 State 7 / Story FFCS-FFCS-E003-S014. * * Composition: * - `lib/ui/dialog` shim (Radix-backed, canonical implementation). * - Siesa UI Kit `Input` (label, error state built-in). * - Siesa UI Kit `Button` for Cancel (outline) and Rename (filled). * - lucide-react `Loader2` spinner while a mutation is in-flight. * - lucide-react `X` for the close button. * - `useFormCacheSelectorSchema` — Zod schema with i18n-bound messages. * * Behavior: * - When opened, the input is pre-filled with `currentName` and focused. * Re-initialisation happens on every false → true transition of `open` * (R-001) — guarantees a stale value never bleeds in. * - Character counter rendered as `{n} / 50` right-aligned below the input. * - On submit: * 1. Run Zod validation locally — show inline error and short-circuit * if invalid. * 2. Call `onSubmit(name)`. The parent hook handles the API call, * 409 surfacing, success banner, and dialog dismissal. * - When the user types, both the local validation error and any server * error (e.g. 409) are cleared so the user can retry without confusion. * - `serverError` is a translation key supplied by the parent (e.g. * `errors.nameAlreadyExists`). The dialog renders it through `t(...)`. */ export interface RenameDialogProps { /** Whether the dialog is currently visible. Controlled by the parent. */ open: boolean; /** Toggle handler — invoked when the dialog wants to close (e.g. cancel). */ onOpenChange: (open: boolean) => void; /** Current cache name — pre-fills the input every time the dialog opens. */ currentName: string; /** * Submit handler. Receives the trimmed user-supplied name. The parent is * responsible for the actual rename call, the 409 → serverError mapping, * and dismissing the dialog on success / 404. */ onSubmit: (name: string) => Promise; /** True while any mutation is in-flight — disables submit, shows spinner. */ isMutating: boolean; /** * Translation key for a server-side error (typically a 409 conflict) to * render inline. `null` when there is no server error to show. */ serverError: string | null; /** Clears the server error — called as the user starts editing the input. */ onServerErrorClear: () => void; } export declare function RenameDialog({ open, onOpenChange, currentName, onSubmit, isMutating, serverError, onServerErrorClear, }: RenameDialogProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=RenameDialog.d.ts.map