Files
DentalManagement09/apps/Frontend/src/components/cloud-storage/new-folder-modal.jsx
T
GiteadandClaude Sonnet 4.6 1edf73fdc8 feat: add new frontend components, MH batch worker, and gitignore rules
- Add all new Frontend source files (pages, components, hooks, utils)
- Add selenium_MHBatchPaymentCheckWorker.py and MHSinglePaymentCheckWorker.py
- Add install-steps-5-13.sh setup script
- Update .gitignore to exclude runtime/sensitive data (backups, uploads,
  chat-history, keys, downloads, generated .d.ts files) while keeping folders
- Add .gitkeep to preserve empty runtime folders in git

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 00:23:43 -04:00

51 lines
1.9 KiB
React

import React, { useEffect, useState } from "react";
import { Button } from "@/components/ui/button";
export function NewFolderModal({ isOpen, initialName = "", title = "New Folder", submitLabel = "Create", onClose, onSubmit, }) {
const [name, setName] = useState(initialName);
const [isSubmitting, setIsSubmitting] = useState(false);
useEffect(() => {
setName(initialName);
}, [initialName, isOpen]);
if (!isOpen)
return null;
return (<div className="fixed inset-0 z-50 flex items-center justify-center">
<div className="absolute inset-0 bg-black/40" onClick={() => {
if (!isSubmitting)
onClose();
}}/>
<div className="relative w-full max-w-md mx-4 bg-white rounded-lg shadow-lg">
<div className="p-4 border-b">
<h3 className="text-lg font-medium">{title}</h3>
</div>
<form onSubmit={async (e) => {
e.preventDefault();
if (!name.trim())
return;
try {
setIsSubmitting(true);
await onSubmit(name.trim());
}
finally {
setIsSubmitting(false);
}
}}>
<div className="p-4 space-y-3">
<label className="block text-sm font-medium">Folder name</label>
<input autoFocus value={name} onChange={(e) => setName(e.target.value)} className="w-full rounded-md border px-3 py-2" placeholder="Enter folder name" disabled={isSubmitting}/>
</div>
<div className="flex items-center justify-end gap-2 p-4 border-t">
<Button variant="ghost" type="button" onClick={() => !isSubmitting && onClose()}>
Cancel
</Button>
<Button type="submit" disabled={isSubmitting || !name.trim()}>
{isSubmitting ? "Saving..." : submitLabel}
</Button>
</div>
</form>
</div>
</div>);
}