diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index e28358f0..cc769832 100644 --- a/src/components/Dashboard.tsx +++ b/src/components/Dashboard.tsx @@ -11,8 +11,16 @@ import { Tooltip, Legend, ResponsiveContainer -} from 'recharts'; -import { Paper, Typography, Box, Grid, Theme } from '@mui/material'; +}from 'recharts'; + +import { + Paper, + Typography, + Box, + Grid, + Theme, + LinearProgress +} from '@mui/material'; interface GitHubItem { id: number; @@ -63,6 +71,27 @@ const Dashboard: React.FC = ({ totalIssues, totalPrs, data, them .slice(0, 5); const hasData = totalIssues > 0 || totalPrs > 0; + const totalContributions = totalIssues + totalPrs; + +const healthScore = Math.min( + 100, + Math.round((totalContributions / 50) * 100) +); + +const healthStatus = + healthScore >= 80 + ? "Excellent" + : healthScore >= 60 + ? "Good" + : healthScore >= 40 + ? "Moderate" + : "Poor"; + + const contributorGrowthData = [ + { month: "Issues", contributions: totalIssues }, + { month: "PRs", contributions: totalPrs }, + { month: "Total", contributions: totalContributions }, +]; if (!hasData) { return ( @@ -76,6 +105,92 @@ const Dashboard: React.FC = ({ totalIssues, totalPrs, data, them return ( + + + Repository Health Score + + + + {healthScore}/100 + + + = 80 + ? "success.main" + : healthScore >= 60 + ? "info.main" + : healthScore >= 40 + ? "warning.main" + : "error.main" + } +> + Status: {healthStatus} + + + + + + + + + Repository Milestone Tracking + + + + Issue Resolution Milestone ({totalIssues}/100) + + + + + Pull Request Milestone ({totalPrs}/100) + + + + + Contributor Milestone ({totalContributions}/200) + + + + {/* Pie Chart: Issues vs PRs */} @@ -111,6 +226,39 @@ const Dashboard: React.FC = ({ totalIssues, totalPrs, data, them {/* Bar Chart: Activity by Repository */} + + + + Contributor Growth Analytics + + + + + + + + + + + + + + + Top Repositories (Current View) diff --git a/src/pages/Tracker/Tracker.tsx b/src/pages/Tracker/Tracker.tsx index 576f39bf..23c288f2 100644 --- a/src/pages/Tracker/Tracker.tsx +++ b/src/pages/Tracker/Tracker.tsx @@ -17,6 +17,7 @@ import { TableCell, TableContainer, TableHead, + Typography, TableRow, TablePagination, Link, @@ -78,6 +79,7 @@ const Home: React.FC = () => { const [selectedRepo, setSelectedRepo] = useState(""); const [startDate, setStartDate] = useState(""); const [endDate, setEndDate] = useState(""); + const [compareUsername, setCompareUsername] = useState(""); // Fetch data when username, tab, or page changes useEffect(() => { @@ -176,6 +178,15 @@ const Home: React.FC = () => { required sx={{ flex: 1, minWidth: 150 }} /> + + + setCompareUsername(e.target.value)} + sx={{ flex: 1, minWidth: 150 }} +/> + { Fetch Data - - + + {/* Filters */} + + + + Activity Comparison + + + + Primary User: {username || "N/A"} + + + + Compare User: {compareUsername || "N/A"} + + + + Issues: {totalIssues} + + + + Pull Requests: {totalPrs} + +