import React from 'react'; import { Button } from './ui/button.js'; export default function MilestoneModal({ show, onClose, milestones, editingMilestone, showForm, handleNewMilestone, handleEditMilestone, handleDeleteMilestone, handleAddTask, showTaskForm, editingTask, handleEditTask, deleteTask, saveTask, saveMilestone, copyWizardMilestone, setCopyWizardMilestone }) { if (!show) return null; // if we don't want to render at all when hidden return (

Edit Milestones

{/* 1) Render existing milestones */} {milestones.map((m) => { const tasks = m.tasks || []; return (
{m.title}
{m.description &&

{m.description}

}

Date: {m.date} — Progress: {m.progress}%

{/* tasks list */} {tasks.length > 0 && (
    {tasks.map((t) => (
  • {t.title} {t.description ? ` - ${t.description}` : ''} {t.due_date ? ` (Due: ${t.due_date})` : ''}{' '}
  • ))}
)} {/* The "Add/Edit Task" form if showTaskForm === m.id */} {showTaskForm === m.id && (
{editingTask.id ? 'Edit Task' : 'New Task'}
{/* same form logic... */}
)}
); })} {/* 2) The big milestone form if showForm is true */} {showForm && (

{editingMilestone ? 'Edit Milestone' : 'New Milestone'}

{/* ... your milestone form code (title, date, impacts, etc.) */}
)} {/* Copy wizard if copyWizardMilestone */} {copyWizardMilestone && (
{/* your copy wizard UI */}
)}
); }