({ showCreateTask, setShowCreateTask, projectId })
| 4 | import { format } from "date-fns"; |
| 5 | |
| 6 | export default function CreateTaskDialog({ showCreateTask, setShowCreateTask, projectId }) { |
| 7 | const currentWorkspace = useSelector((state) => state.workspace?.currentWorkspace || null); |
| 8 | const project = currentWorkspace?.projects.find((p) => p.id === projectId); |
| 9 | const teamMembers = project?.members || []; |
| 10 | |
| 11 | const [isSubmitting, setIsSubmitting] = useState(false); |
| 12 | const [formData, setFormData] = useState({ |
| 13 | title: "", |
| 14 | description: "", |
| 15 | type: "TASK", |
| 16 | status: "TODO", |
| 17 | priority: "MEDIUM", |
| 18 | assigneeId: "", |
| 19 | due_date: "", |
| 20 | }); |
| 21 | |
| 22 | const handleSubmit = async (e) => { |
| 23 | e.preventDefault(); |
| 24 | |
| 25 | |
| 26 | }; |
| 27 | |
| 28 | return showCreateTask ? ( |
| 29 | <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/20 dark:bg-black/60 backdrop-blur"> |
| 30 | <div className="bg-white dark:bg-zinc-950 border border-zinc-300 dark:border-zinc-800 rounded-lg shadow-lg w-full max-w-md p-6 text-zinc-900 dark:text-white"> |
| 31 | <h2 className="text-xl font-bold mb-4">Create New Task</h2> |
| 32 | |
| 33 | <form onSubmit={handleSubmit} className="space-y-4"> |
| 34 | {/* Title */} |
| 35 | <div className="space-y-1"> |
| 36 | <label htmlFor="title" className="text-sm font-medium">Title</label> |
| 37 | <input value={formData.title} onChange={(e) => setFormData({ ...formData, title: e.target.value })} placeholder="Task title" className="w-full rounded dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-700 px-3 py-2 text-zinc-900 dark:text-zinc-200 text-sm mt-1 focus:outline-none focus:ring-2 focus:ring-blue-500" required /> |
| 38 | </div> |
| 39 | |
| 40 | {/* Description */} |
| 41 | <div className="space-y-1"> |
| 42 | <label htmlFor="description" className="text-sm font-medium">Description</label> |
| 43 | <textarea value={formData.description} onChange={(e) => setFormData({ ...formData, description: e.target.value })} placeholder="Describe the task" className="w-full rounded dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-700 px-3 py-2 text-zinc-900 dark:text-zinc-200 text-sm mt-1 h-24 focus:outline-none focus:ring-2 focus:ring-blue-500" /> |
| 44 | </div> |
| 45 | |
| 46 | {/* Type & Priority */} |
| 47 | <div className="grid grid-cols-2 gap-4"> |
| 48 | <div className="space-y-1"> |
| 49 | <label className="text-sm font-medium">Type</label> |
| 50 | <select value={formData.type} onChange={(e) => setFormData({ ...formData, type: e.target.value })} className="w-full rounded dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-700 px-3 py-2 text-zinc-900 dark:text-zinc-200 text-sm mt-1" > |
| 51 | <option value="BUG">Bug</option> |
| 52 | <option value="FEATURE">Feature</option> |
| 53 | <option value="TASK">Task</option> |
| 54 | <option value="IMPROVEMENT">Improvement</option> |
| 55 | <option value="OTHER">Other</option> |
| 56 | </select> |
| 57 | </div> |
| 58 | |
| 59 | <div className="space-y-1"> |
| 60 | <label className="text-sm font-medium">Priority</label> |
| 61 | <select value={formData.priority} onChange={(e) => setFormData({ ...formData, priority: e.target.value })} className="w-full rounded dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-700 px-3 py-2 text-zinc-900 dark:text-zinc-200 text-sm mt-1" > |
| 62 | <option value="LOW">Low</option> |
| 63 | <option value="MEDIUM">Medium</option> |
nothing calls this directly
no outgoing calls
no test coverage detected