"use client"; import { useState } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { X, Plus } from "lucide-react"; interface Props { open: boolean; onClose: () => void; onAdd: (title: string) => void; } export default function AddTaskModal({ open, onClose, onAdd }: Props) { const [title, setTitle] = useState(""); const handleSubmit = () => { if (!title.trim()) return; onAdd(title.trim()); setTitle(""); onClose(); }; return ( {open && ( e.stopPropagation()} >

Новая задача

setTitle(e.target.value)} onKeyDown={(e) => e.key === "Enter" && handleSubmit()} placeholder="Название задачи..." autoFocus className="w-full px-4 py-3 rounded-xl text-sm outline-none mb-4" style={{ background: "rgba(255,255,255,0.06)", border: "1px solid rgba(255,255,255,0.1)", color: "var(--text-primary)", }} />
Отмена Добавить
)}
); }