- Created TaskList component with WeeklyTaskItem - Created WeeklyCalendarView component with drag-and-drop functionality - Created main tasks page with integration - Added TaskForm component for creating new tasks - Implemented navigation controls for week switching - Added responsive styling for all components Files created: - src/components/TaskList.tsx - src/components/WeeklyCalendarView.tsx - src/app/tasks/page.tsx - src/components/TaskForm.tsx - src/components/WeeklyTaskItem.tsx - src/app/globals.css
42 lines
835 B
TypeScript
42 lines
835 B
TypeScript
import React from 'react';
|
|
import WeeklyTaskItem from './WeeklyTaskItem';
|
|
|
|
interface Task {
|
|
id: string;
|
|
title: string;
|
|
description?: string;
|
|
completed: boolean;
|
|
startTime?: string;
|
|
endTime?: string;
|
|
dayOfWeek?: number; // 0 = Sunday, 1 = Monday, etc.
|
|
}
|
|
|
|
interface TaskListProps {
|
|
tasks: Task[];
|
|
onTaskClick?: (task: Task) => void;
|
|
}
|
|
|
|
const TaskList: React.FC<TaskListProps> = ({ tasks, onTaskClick }) => {
|
|
if (tasks.length === 0) {
|
|
return (
|
|
<div className="empty-state">
|
|
<p>No tasks found</p>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<ul className="task-list">
|
|
{tasks.map((task) => (
|
|
<li key={task.id}>
|
|
<WeeklyTaskItem
|
|
task={task}
|
|
onClick={() => onTaskClick?.(task)}
|
|
/>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
);
|
|
};
|
|
|
|
export default TaskList; |