diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index d3daad7..7fbba1c 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -2,6 +2,7 @@ import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Dashboard } from '@/components/dashboard/Dashboard'; import { PromptActivity } from '@/components/prompts/PromptActivity'; +import { TaskFlow } from '@/components/taskflow/TaskFlow'; import { Login } from '@/components/auth/Login'; import { AuthGuard } from '@/components/auth/AuthGuard'; @@ -28,6 +29,14 @@ function App() { } /> + }> + + + } + />
+ {/* Quick Navigation */} + + + + + Quick Actions + + Access key features and tools + + +
+ + + + + +
+
+
+
diff --git a/frontend/src/components/taskflow/TaskFlow.tsx b/frontend/src/components/taskflow/TaskFlow.tsx new file mode 100644 index 0000000..4e8b17d --- /dev/null +++ b/frontend/src/components/taskflow/TaskFlow.tsx @@ -0,0 +1,213 @@ +import { useState } from 'react'; +import { Button } from '@/components/ui/button'; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; +import { Badge } from '@/components/ui/badge'; +import { Layout } from '@/components/layout/Layout'; +import { useAuth } from '@/hooks/useAuth'; +import { Plus, CheckCircle, Clock, AlertCircle, Play, Pause } from 'lucide-react'; + +interface Task { + id: string; + title: string; + description: string; + status: 'pending' | 'in-progress' | 'completed' | 'blocked'; + priority: 'low' | 'medium' | 'high'; + assignee?: string; + dueDate?: string; +} + +interface TaskFlowProps { + title?: string; + description?: string; +} + +const sampleTasks: Task[] = [ + { + id: '1', + title: 'Design System Setup', + description: 'Create base components and design tokens for the application', + status: 'completed', + priority: 'high', + assignee: 'John Doe', + dueDate: '2025-01-15' + }, + { + id: '2', + title: 'API Integration', + description: 'Integrate frontend with backend API endpoints', + status: 'in-progress', + priority: 'high', + assignee: 'Jane Smith' + }, + { + id: '3', + title: 'User Authentication', + description: 'Implement login, logout, and session management', + status: 'pending', + priority: 'medium', + assignee: 'Mike Johnson', + dueDate: '2025-01-20' + }, + { + id: '4', + title: 'Testing Setup', + description: 'Configure unit and integration testing framework', + status: 'blocked', + priority: 'medium' + } +]; + +const statusConfig = { + pending: { icon: Clock, color: 'bg-gray-100 text-gray-800 border-gray-200', iconColor: 'text-gray-600' }, + 'in-progress': { icon: Play, color: 'bg-blue-100 text-blue-800 border-blue-200', iconColor: 'text-blue-600' }, + completed: { icon: CheckCircle, color: 'bg-green-100 text-green-800 border-green-200', iconColor: 'text-green-600' }, + blocked: { icon: AlertCircle, color: 'bg-red-100 text-red-800 border-red-200', iconColor: 'text-red-600' } +}; + +const priorityConfig = { + low: 'bg-gray-100 text-gray-800', + medium: 'bg-yellow-100 text-yellow-800', + high: 'bg-red-100 text-red-800' +}; + +export function TaskFlow({ title = "Task Flow", description = "Manage and track your project tasks" }: TaskFlowProps) { + const [tasks] = useState(sampleTasks); + const [filter, setFilter] = useState('all'); + const { data: user } = useAuth(); + + const filteredTasks = tasks.filter(task => { + if (filter === 'all') return true; + return task.status === filter; + }); + + const statusCounts = { + pending: tasks.filter(t => t.status === 'pending').length, + 'in-progress': tasks.filter(t => t.status === 'in-progress').length, + completed: tasks.filter(t => t.status === 'completed').length, + blocked: tasks.filter(t => t.status === 'blocked').length + }; + + return ( + +
+ {/* Header */} +
+
+

{title}

+

{description}

+
+ +
+ + {/* Status Overview */} +
+ {Object.entries(statusCounts).map(([status, count]) => { + const config = statusConfig[status as keyof typeof statusConfig]; + const StatusIcon = config.icon; + return ( + setFilter(filter === status ? 'all' : status)} + > + +
+ +
+

{status.replace('-', ' ')}

+

{count}

+
+
+
+
+ ); + })} +
+ + {/* Filter Buttons */} +
+ + {Object.entries(statusCounts).map(([status, count]) => ( + + ))} +
+ + {/* Tasks Grid */} +
+ {filteredTasks.map((task) => { + const statusConf = statusConfig[task.status]; + const StatusIcon = statusConf.icon; + + return ( + + +
+ {task.title} + + {task.priority} + +
+ {task.description} +
+ + +
+ + + {task.status.replace('-', ' ')} + +
+ + {task.assignee && ( +
+

Assignee

+

{task.assignee}

+
+ )} + + {task.dueDate && ( +
+

Due Date

+

{task.dueDate}

+
+ )} +
+
+ ); + })} +
+ + {filteredTasks.length === 0 && ( + +
+ +

No tasks found

+

+ {filter === 'all' + ? 'No tasks have been created yet.' + : `No tasks with status "${filter.replace('-', ' ')}" found.` + } +

+
+
+ )} +
+
+ ); +} \ No newline at end of file