diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index e28358f0..166f2bb1 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,52 @@ 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} + + + + + {/* Pie Chart: Issues vs PRs */} @@ -111,6 +186,39 @@ const Dashboard: React.FC = ({ totalIssues, totalPrs, data, them {/* Bar Chart: Activity by Repository */} + + + + Contributor Growth Analytics + + + + + + + + + + + + + + + Top Repositories (Current View)