"use client"; import { useState } from "react"; import { useTranslations } from "next-intl"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; interface NewFolderDialogProps { onConfirm: (name: string) => Promise; onCancel: () => void; } export function NewFolderDialog({ onConfirm, onCancel }: NewFolderDialogProps) { const t = useTranslations("files"); const [name, setName] = useState(""); const [isSubmitting, setIsSubmitting] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); const trimmed = name.trim(); if (!trimmed) return; setIsSubmitting(true); try { await onConfirm(trimmed); } finally { setIsSubmitting(false); } }; return (
e.stopPropagation()} >

{t("new_folder")}

setName(e.target.value)} placeholder={t("new_folder_name")} className="mb-4" />
); }