'use client'; import { DailyCheckbox, DailyCheckboxType } from '@/lib/types'; import { Card } from '@/components/ui/Card'; import { Button } from '@/components/ui/Button'; import { DailyCheckboxItem } from './DailyCheckboxItem'; import { DailyAddForm } from './DailyAddForm'; interface DailySectionProps { title: string; date: Date; checkboxes: DailyCheckbox[]; onAddCheckbox: (text: string, type: DailyCheckboxType) => Promise; onToggleCheckbox: (checkboxId: string) => Promise; onUpdateCheckbox: (checkboxId: string, text: string, type: DailyCheckboxType, taskId?: string) => Promise; onDeleteCheckbox: (checkboxId: string) => Promise; onToggleAll?: () => Promise; saving: boolean; refreshing?: boolean; } export function DailySection({ title, date, checkboxes, onAddCheckbox, onToggleCheckbox, onUpdateCheckbox, onDeleteCheckbox, onToggleAll, saving, refreshing = false }: DailySectionProps) { const formatShortDate = (date: Date) => { return date.toLocaleDateString('fr-FR', { day: '2-digit', month: '2-digit', year: 'numeric' }); }; return ( {/* Header */}

{title} ({formatShortDate(date)}) {refreshing && (
)}

{checkboxes.filter(cb => cb.isChecked).length}/{checkboxes.length} {onToggleAll && checkboxes.length > 0 && ( )}
{/* Liste des checkboxes - zone scrollable */}
{checkboxes.map((checkbox) => ( ))} {checkboxes.length === 0 && (
Aucune tâche pour cette période
)}
{/* Footer - Formulaire d'ajout toujours en bas */}
); }