diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx new file mode 100644 index 0000000..6e2f6ac --- /dev/null +++ b/src/pages/Index.tsx @@ -0,0 +1,167 @@ +import { useState } from "react"; +import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { Avatar, AvatarFallback } from "@/components/ui/avatar"; +import { Checkbox } from "@/components/ui/checkbox"; +import { Separator } from "@/components/ui/separator"; +import { + FolderKanban, ListChecks, CheckCircle2, AlertTriangle, + Clock, ArrowUpRight, MoreHorizontal, Plus +} from "lucide-react"; +import { toast } from "sonner"; +import Sidebar from "@/components/Sidebar"; +import Header from "@/components/Header"; + +const kpiCards = [ + { + title: "Total Projects", + value: "24", + change: "+3 this month", + icon: FolderKanban, + color: "text-violet-600 bg-violet-100", + }, + { + title: "Active Tasks", + value: "142", + change: "+18 this week", + icon: ListChecks, + color: "text-indigo-600 bg-indigo-100", + }, + { + title: "Completed This Week", + value: "38", + change: "+12% vs last week", + icon: CheckCircle2, + color: "text-emerald-600 bg-emerald-100", + }, + { + title: "Overdue", + value: "7", + change: "-2 from yesterday", + icon: AlertTriangle, + color: "text-red-600 bg-red-100", + }, +]; + +const activityFeed = [ + { initials: "AK", name: "Alex Kim", action: "completed the homepage redesign task", time: "5 minutes ago", color: "bg-violet-500" }, + { initials: "MR", name: "Maria Rodriguez", action: "moved API integration to In Progress", time: "22 minutes ago", color: "bg-indigo-500" }, + { initials: "JL", name: "Jordan Lee", action: "added a comment on the onboarding flow", time: "1 hour ago", color: "bg-emerald-500" }, + { initials: "SC", name: "Sam Chen", action: "created a new project: Mobile App v2", time: "3 hours ago", color: "bg-amber-500" }, + { initials: "TP", name: "Taylor Park", action: "uploaded design assets to the brand kit", time: "5 hours ago", color: "bg-sky-500" }, +]; + +const myTasks = [ + { id: 1, title: "Design system color tokens", priority: "High", priorityColor: "bg-red-100 text-red-700", due: "Apr 13", assignee: "AK", done: false }, + { id: 2, title: "API integration for user auth", priority: "High", priorityColor: "bg-red-100 text-red-700", due: "Apr 14", assignee: "MR", done: false }, + { id: 3, title: "Update onboarding flow copy", priority: "Medium", priorityColor: "bg-amber-100 text-amber-700", due: "Apr 15", assignee: "JL", done: false }, + { id: 4, title: "Fix sidebar responsive layout", priority: "Medium", priorityColor: "bg-amber-100 text-amber-700", due: "Apr 16", assignee: "SC", done: true }, + { id: 5, title: "Write unit tests for dashboard", priority: "Low", priorityColor: "bg-slate-100 text-slate-700", due: "Apr 18", assignee: "TP", done: false }, +]; + +export default function IndexPage() { + const [tasks, setTasks] = useState(myTasks); + + const toggleTask = (id: number) => { + setTasks(prev => prev.map(t => t.id === id ? { ...t, done: !t.done } : t)); + toast("Task completed!"); + }; + + return ( +
+ +
+
+
+ {/* ── Welcome ── */} +
+

Welcome back, Alex

+

Here is what is happening across your projects today.

+
+ + {/* ── KPI Cards ── */} +
+ {kpiCards.map((kpi) => ( + + +
+
+ +
+ +
+
+

{kpi.value}

+

{kpi.title}

+

{kpi.change}

+
+
+
+ ))} +
+ +
+ {/* ── Recent Activity ── */} + + +
+ Recent Activity + Latest actions across your workspace +
+ +
+ + {activityFeed.map((item, i) => ( +
+
+ {item.initials} +
+
+

+ {item.name}{" "}{item.action} +

+

+ {item.time} +

+
+
+ ))} +
+
+ + {/* ── My Tasks ── */} + + +
+ My Tasks + Your assigned tasks for this sprint +
+ +
+ + {tasks.map((task) => ( +
+ toggleTask(task.id)} className="border-slate-300 data-[state=checked]:bg-violet-600 data-[state=checked]:border-violet-600" /> +
+

{task.title}

+
+ {task.priority} + {task.due} + + {task.assignee} + +
+ ))} +
+
+
+
+
+
+ ); +}