diff --git a/src/components/AIExecutiveSummary.tsx b/src/components/AIExecutiveSummary.tsx
index ef296a9..46cd49e 100644
--- a/src/components/AIExecutiveSummary.tsx
+++ b/src/components/AIExecutiveSummary.tsx
@@ -1,44 +1,192 @@
-import { Sparkles, Expand, RefreshCw } from "lucide-react";
+import { useState, useEffect } from "react";
+import { Sparkles, Expand, RefreshCw, TrendingUp, AlertTriangle, CheckCircle } from "lucide-react";
+import { motion, AnimatePresence } from "framer-motion";
const AIExecutiveSummary = () => {
+ const [isGenerating, setIsGenerating] = useState(false);
+ const [currentInsight, setCurrentInsight] = useState(0);
+ const [isExpanded, setIsExpanded] = useState(false);
+
+ const insights = [
+ {
+ title: "Team Productivity Surge",
+ content: "Your team has completed 73% more tasks this week compared to last week. The Development team is leading with 18 completed tasks.",
+ type: "positive",
+ icon: TrendingUp,
+ color: "text-green-600",
+ bgColor: "bg-green-50",
+ borderColor: "border-green-200"
+ },
+ {
+ title: "Bottleneck Alert",
+ content: "The Review process is experiencing delays with 8 pending tasks. Consider allocating additional reviewers to maintain workflow.",
+ type: "warning",
+ icon: AlertTriangle,
+ color: "text-amber-600",
+ bgColor: "bg-amber-50",
+ borderColor: "border-amber-200"
+ },
+ {
+ title: "Sprint Goal Achievement",
+ content: "You're on track to exceed your sprint goal by 15%. Current completion rate suggests finishing 2 days ahead of schedule.",
+ type: "success",
+ icon: CheckCircle,
+ color: "text-blue-600",
+ bgColor: "bg-blue-50",
+ borderColor: "border-blue-200"
+ }
+ ];
+
+ const recommendations = [
+ "Consider redistributing 3 tasks from Design to Development team",
+ "Schedule additional code review sessions for Thursday",
+ "Celebrate team achievements to maintain momentum"
+ ];
+
+ const handleRefresh = () => {
+ setIsGenerating(true);
+ setTimeout(() => {
+ setIsGenerating(false);
+ setCurrentInsight((prev) => (prev + 1) % insights.length);
+ }, 2000);
+ };
+
+ useEffect(() => {
+ const interval = setInterval(() => {
+ setCurrentInsight((prev) => (prev + 1) % insights.length);
+ }, 8000);
+ return () => clearInterval(interval);
+ }, [insights.length]);
+
+ const currentData = insights[currentInsight];
+ const IconComponent = currentData.icon;
+
return (
-
+
-
-
+
+
+
+
+ {isGenerating && (
+
+ )}
AI Executive Summary
-
Refreshed 3 mins ago
+
+ {isGenerating ? "Generating insights..." : "Updated just now"}
+
-
-
-
-
Executive Summary
-
- No tasks were updated in the last week.
-
-
+ {/* Main Insight Card */}
+
+
+
+
+
+
+
+
+ {currentData.title}
+
+
+ {currentData.content}
+
+
+
+
+
+
+ {/* Insight Indicators */}
+
+ {insights.map((_, index) => (
+ setCurrentInsight(index)}
+ className={`w-2 h-2 rounded-full transition-all duration-200 ${
+ index === currentInsight ? 'bg-purple-600 w-4' : 'bg-gray-300 hover:bg-gray-400'
+ }`}
+ />
+ ))}
+
+ {/* Recommendations Section */}
+
-
- Key Efforts & Initiatives
+
+
+ AI Recommendations
-
There are no active tasks.
+
+ {recommendations.map((rec, index) => (
+
+
+ {index + 1}
+
+ {rec}
+
+ ))}
+
+
+ {isExpanded && (
+
+ Detailed Analytics
+
+
+
92%
+
Team Efficiency
+
+
+
+18%
+
Week over Week
+
+
+
+ )}
);
diff --git a/src/components/DashboardControls.tsx b/src/components/DashboardControls.tsx
index 9c58a18..fb69aff 100644
--- a/src/components/DashboardControls.tsx
+++ b/src/components/DashboardControls.tsx
@@ -1,14 +1,46 @@
-import { useState } from "react";
-import { RefreshCw, Filter, Plus } from "lucide-react";
+import { useState, useEffect } from "react";
+import { RefreshCw, Filter, Plus, ChevronDown } from "lucide-react";
+import { motion, AnimatePresence } from "framer-motion";
const DashboardControls = () => {
const [editMode, setEditMode] = useState(false);
const [autoRefresh, setAutoRefresh] = useState(true);
+ const [isRefreshing, setIsRefreshing] = useState(false);
+ const [lastRefresh, setLastRefresh] = useState("3 mins ago");
+ const [filterCount, setFilterCount] = useState(0);
+ const [showFilters, setShowFilters] = useState(false);
+
+ const handleRefresh = () => {
+ setIsRefreshing(true);
+ setTimeout(() => {
+ setIsRefreshing(false);
+ setLastRefresh("just now");
+ }, 1500);
+ };
+
+ const toggleFilter = () => {
+ setFilterCount(prev => prev === 0 ? 1 : 0);
+ };
+
+ useEffect(() => {
+ if (autoRefresh) {
+ const interval = setInterval(() => {
+ setLastRefresh(prev => {
+ if (prev === "just now") return "1 min ago";
+ if (prev === "1 min ago") return "2 mins ago";
+ if (prev === "2 mins ago") return "3 mins ago";
+ return "3 mins ago";
+ });
+ }, 60000);
+ return () => clearInterval(interval);
+ }
+ }, [autoRefresh]);
return (
+ {/* Edit Mode Toggle */}
Edit mode:
{
editMode ? "bg-teal-600" : "bg-gray-200"
}`}
>
-
+ {editMode && (
+
+ Active
+
+ )}
+ {/* Refresh Status */}
-
-
- Refreshed 3 mins ago
-
+
+
+ {isRefreshing ? "Refreshing..." : `Refreshed ${lastRefresh}`}
+
+ {/* Auto Refresh Toggle */}
Auto refresh:
{
autoRefresh ? "bg-teal-600" : "bg-gray-200"
}`}
>
-
- On
+
+ {autoRefresh ? 'On' : 'Off'}
+
-
-
- Filters
-
+ {/* Filters */}
+
+
setShowFilters(!showFilters)}
+ className="flex items-center space-x-2 px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100 rounded-md transition-colors border border-gray-200"
+ >
+
+ Filters
+
+ {filterCount > 0 && (
+
+ {filterCount}
+
+ )}
+
+
+ {/* Filter Dropdown */}
+
+ {showFilters && (
+
+ Filter Options
+
+ {['Status', 'Assignee', 'Priority', 'Date'].map((filter) => (
+
+ ))}
+
+ setShowFilters(false)}
+ className="mt-3 w-full px-3 py-1.5 bg-teal-600 text-white rounded-md text-sm hover:bg-teal-700 transition-colors"
+ >
+ Apply Filters
+
+
+ )}
+
+
+ {/* Add Card Button */}
Add card
+
+ {/* Active filters display */}
+
+ {filterCount > 0 && (
+
+ Active filters:
+
+ Status: In Progress
+
+ setFilterCount(0)}
+ className="text-gray-400 hover:text-gray-600 text-xs"
+ >
+ Clear all
+
+
+ )}
+
);
};
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
index c6517b2..3143bef 100644
--- a/src/components/Sidebar.tsx
+++ b/src/components/Sidebar.tsx
@@ -38,7 +38,7 @@ const Sidebar = () => {
];
return (
-
+
diff --git a/src/components/TaskCharts.tsx b/src/components/TaskCharts.tsx
index 31cf79c..47f178f 100644
--- a/src/components/TaskCharts.tsx
+++ b/src/components/TaskCharts.tsx
@@ -1,3 +1,4 @@
+import { useState } from "react";
import {
PieChart,
Pie,
@@ -7,81 +8,226 @@ import {
XAxis,
YAxis,
ResponsiveContainer,
+ Tooltip,
+ LineChart,
+ Line,
} from "recharts";
+import { motion } from "framer-motion";
const TaskCharts = () => {
+ const [activeIndex, setActiveIndex] = useState(-1);
+ const [selectedChart, setSelectedChart] = useState
(null);
+
const pieData = [
- { name: "Assigned", value: 20 },
- { name: "Unassigned", value: 80 },
+ { name: "Assigned", value: 65, color: "#10B981" },
+ { name: "Unassigned", value: 35, color: "#9CA3AF" },
];
const barData = [
- { name: "User A", value: 7 },
- { name: "User B", value: 6 },
- { name: "User C", value: 5 },
- { name: "User D", value: 4 },
- { name: "User E", value: 3 },
+ { name: "Alice", value: 8, avatar: "👩💼" },
+ { name: "Bob", value: 6, avatar: "👨💻" },
+ { name: "Carol", value: 5, avatar: "👩🎨" },
+ { name: "David", value: 4, avatar: "👨🔬" },
+ { name: "Emma", value: 3, avatar: "👩🚀" },
+ ];
+
+ const weeklyData = [
+ { day: "Mon", completed: 12, pending: 3 },
+ { day: "Tue", completed: 15, pending: 5 },
+ { day: "Wed", completed: 8, pending: 7 },
+ { day: "Thu", completed: 18, pending: 2 },
+ { day: "Fri", completed: 22, pending: 4 },
+ { day: "Sat", completed: 5, pending: 1 },
+ { day: "Sun", completed: 3, pending: 0 },
];
- const COLORS = ["#9CA3AF", "#E5E7EB"];
+ const onPieEnter = (_: unknown, index: number) => {
+ setActiveIndex(index);
+ };
+
+ const onPieLeave = () => {
+ setActiveIndex(-1);
+ };
+
+ const CustomTooltip = ({ active, payload, label }: { active?: boolean; payload?: Array<{ value: number; payload: Record }>; label?: string }) => {
+ if (active && payload && payload.length) {
+ return (
+
+
{`${label}: ${payload[0].value} tasks`}
+
+ );
+ }
+ return null;
+ };
+
+ const PieTooltip = ({ active, payload }: { active?: boolean; payload?: Array<{ name: string; value: number }> }) => {
+ if (active && payload && payload.length) {
+ return (
+
+
{`${payload[0].name}: ${payload[0].value}%`}
+
+ );
+ }
+ return null;
+ };
return (
-
-
+
+ {/* Pie Chart */}
+
setSelectedChart(selectedChart === 'pie' ? null : 'pie')}
+ >
Total Tasks by Assignee
-
+
- {pieData.map((entry, index) => (
+ {pieData.map((entry) => (
|
))}
+ } />
-
+
+ {pieData.map((entry) => (
+
+
+
{entry.name} ({entry.value}%)
+
+ ))}
+
+
-
+ {/* Bar Chart */}
+
setSelectedChart(selectedChart === 'bar' ? null : 'bar')}
+ >
Open Tasks by Assignee
- Tasks
-
+
Active Tasks
+
-
-
-
-
+
+
+
+ } />
+
-
+
+ {barData.slice(0, 3).map((user) => (
+
+
{user.avatar}
+
{user.name}
+
{user.value}
+
+ ))}
+
+
-
+ {/* Line Chart */}
+
setSelectedChart(selectedChart === 'line' ? null : 'line')}
+ >
- Tasks Completed This Week
+ Weekly Task Completion
-
-
-
📋
-
No Results
+
Last 7 days
+
+
+
+
+
+ } />
+
+
+
+
+
+
-
+
);
};
diff --git a/src/components/TaskStatusOverview.tsx b/src/components/TaskStatusOverview.tsx
index b8980bc..7898b26 100644
--- a/src/components/TaskStatusOverview.tsx
+++ b/src/components/TaskStatusOverview.tsx
@@ -1,26 +1,123 @@
+import { useState, useEffect } from "react";
+import { Clock, CheckCircle, AlertCircle, TrendingUp } from "lucide-react";
+import { motion } from "framer-motion";
+
const TaskStatusOverview = () => {
+ const [animateNumbers, setAnimateNumbers] = useState(false);
+
const statusData = [
- { label: "Unassigned", count: 6, color: "bg-gray-100 text-gray-700" },
- { label: "In Progress", count: 1, color: "bg-blue-100 text-blue-700" },
- { label: "Completed", count: 0, color: "bg-green-100 text-green-700" },
+ {
+ label: "Unassigned",
+ count: 8,
+ color: "bg-gray-50 border-gray-200",
+ textColor: "text-gray-700",
+ numberColor: "text-gray-900",
+ icon: AlertCircle,
+ iconColor: "text-gray-500",
+ trend: "+2 from yesterday",
+ trendColor: "text-gray-600"
+ },
+ {
+ label: "In Progress",
+ count: 12,
+ color: "bg-blue-50 border-blue-200",
+ textColor: "text-blue-700",
+ numberColor: "text-blue-600",
+ icon: Clock,
+ iconColor: "text-blue-500",
+ trend: "+5 from yesterday",
+ trendColor: "text-blue-600"
+ },
+ {
+ label: "Completed",
+ count: 24,
+ color: "bg-green-50 border-green-200",
+ textColor: "text-green-700",
+ numberColor: "text-green-600",
+ icon: CheckCircle,
+ iconColor: "text-green-500",
+ trend: "+8 from yesterday",
+ trendColor: "text-green-600"
+ },
];
+ useEffect(() => {
+ const timer = setTimeout(() => setAnimateNumbers(true), 100);
+ return () => clearTimeout(timer);
+ }, []);
+
+ const CountUpAnimation = ({ target, className }: { target: number; className: string }) => {
+ const [current, setCurrent] = useState(0);
+
+ useEffect(() => {
+ if (!animateNumbers) return;
+
+ const increment = target / 20;
+ const timer = setInterval(() => {
+ setCurrent(prev => {
+ const next = prev + increment;
+ if (next >= target) {
+ clearInterval(timer);
+ return target;
+ }
+ return next;
+ });
+ }, 50);
+
+ return () => clearInterval(timer);
+ }, [target]);
+
+ return (
+
+ {Math.floor(current)}
+
+ );
+ };
+
return (
- {statusData.map((status, index) => (
-
-
- {status.label}
-
-
- {status.count}
-
-
tasks
-
- ))}
+ {statusData.map((status, index) => {
+ const IconComponent = status.icon;
+ return (
+
+
+
+ {status.label}
+
+
+
+
+
+
+ tasks
+
+
+
+ {status.trend}
+
+
+ {/* Simple progress indicator */}
+
+
+
+
+ );
+ })}
);
};
diff --git a/src/components/WorkloadChart.tsx b/src/components/WorkloadChart.tsx
index 9ea1645..a7b0893 100644
--- a/src/components/WorkloadChart.tsx
+++ b/src/components/WorkloadChart.tsx
@@ -1,29 +1,176 @@
-import { BarChart, Bar, XAxis, YAxis, ResponsiveContainer } from "recharts";
+import { useState } from "react";
+import { BarChart, Bar, XAxis, YAxis, ResponsiveContainer, Tooltip, Cell } from "recharts";
+import { Users, Activity, Target } from "lucide-react";
+import { motion } from "framer-motion";
const WorkloadChart = () => {
- const data = [{ name: "Workload", gray: 85, blue: 15 }];
+ const [activeBar, setActiveBar] = useState(null);
+
+ const data = [
+ { name: "Development", completed: 45, inProgress: 25, pending: 15, total: 85 },
+ { name: "Design", completed: 30, inProgress: 20, pending: 10, total: 60 },
+ { name: "Testing", completed: 20, inProgress: 15, pending: 5, total: 40 },
+ { name: "Review", completed: 35, inProgress: 10, pending: 8, total: 53 },
+ ];
+
+ const teamStats = [
+ { label: "Active Members", value: 12, icon: Users, color: "text-gray-600" },
+ { label: "Capacity Used", value: "73%", icon: Activity, color: "text-blue-600" },
+ { label: "Weekly Goal", value: "85%", icon: Target, color: "text-green-600" },
+ ];
+
+ const CustomTooltip = ({ active, payload, label }: {
+ active?: boolean;
+ payload?: Array<{ payload: { completed: number; inProgress: number; pending: number; total: number } }>;
+ label?: string
+ }) => {
+ if (active && payload && payload.length) {
+ const data = payload[0].payload;
+ return (
+
+
{label}
+
+
+
+
Completed: {data.completed}
+
+
+
+
In Progress: {data.inProgress}
+
+
+
+
Pending: {data.pending}
+
+
+
+ Total: {data.total} tasks
+
+
+ );
+ }
+ return null;
+ };
return (
-
-
- Workload by Status
-
-
+
+
+
+ Team Workload Overview
+
+
+
+
+ {/* Team Stats */}
+
+ {teamStats.map((stat, index) => {
+ const IconComponent = stat.icon;
+ return (
+
+
+ {stat.value}
+ {stat.label}
+
+ );
+ })}
+
+
+
-
-
-
-
-
+ {
+ if (e && e.activeTooltipIndex !== undefined) {
+ setActiveBar(e.activeTooltipIndex);
+ }
+ }}
+ onMouseLeave={() => setActiveBar(null)}
+ >
+
+
+ } />
+
+ {data.map((entry, index) => (
+ |
+ ))}
+
+
+ {data.map((entry, index) => (
+ |
+ ))}
+
+
+ {data.map((entry, index) => (
+ |
+ ))}
+
-
-
0
-
Tasks
-
100
+
+ {/* Legend */}
+
-
+
);
};