import React from 'react'; import { useTranslation } from 'react-i18next'; import { CalendarDaysIcon } from '@heroicons/react/24/outline'; import TaskList from './TaskList'; import { Task } from '../../entities/Task'; import { Project } from '../../entities/Project'; interface TodayPlanProps { todayPlanTasks: Task[] | undefined; projects: Project[]; onTaskUpdate: (task: Task) => Promise; onTaskDelete: (taskId: number) => Promise; onToggleToday?: (taskId: number) => Promise; } const TodayPlan: React.FC = ({ todayPlanTasks, projects, onTaskUpdate, onTaskDelete, onToggleToday, }) => { const { t } = useTranslation(); // Handle undefined or null todayPlanTasks const safeTodayPlanTasks = todayPlanTasks || []; if (safeTodayPlanTasks.length === 0) { return ( <>

{t( 'tasks.noPlanToday', 'No tasks planned for today yet' )}

{t( 'tasks.addToPlanHint', 'Click the "add to today plan" icon on the right of any task to add it here' )}

); } return ( <> ); }; export default TodayPlan;