@@ -25,46 +25,56 @@ export default function AdminDashboardApplicantStatusPie({
2525 data,
2626} : AdminDashboardApplicantStatusPieProps ) {
2727 const title = "Total Applicant Status" ;
28+
2829 if ( ! data )
2930 return (
30- < Card className = "flex h-full flex-col bg-black " >
31+ < Card className = "flex h-full flex-col" >
3132 < CardHeader className = "items-center pb-0" >
32- < CardTitle > { title } </ CardTitle >
33+ < CardTitle className = "text-lg" > { title } </ CardTitle >
3334 </ CardHeader >
35+ < CardContent className = "flex flex-1 items-center justify-center" >
36+ < p className = "text-muted-foreground" > No data available</ p >
37+ </ CardContent >
3438 </ Card >
3539 ) ;
3640
3741 const chartData = Object . keys ( data || { } ) . map ( ( status ) => ( {
3842 status,
3943 applicants : data [ status ] ,
40- fill : `var(--color-${ status } )` , // Assuming your color variable names match the status
44+ fill : `var(--color-${ status } )` ,
4145 } ) ) ;
4246
4347 const chartConfig = Object . keys ( data || { } ) . reduce (
4448 ( config , status ) => {
45- const capitalizedLabel = status . charAt ( 0 ) . toUpperCase ( ) + status . slice ( 1 ) ; // Capitalize the first letter
49+ const capitalizedLabel = status . charAt ( 0 ) . toUpperCase ( ) + status . slice ( 1 ) ;
4650 config [ status ] = {
4751 label : capitalizedLabel ,
48- color : `hsl(var(--chart-${ Object . keys ( config ) . length + 1 } ))` , // Generate color based on index
52+ color : `hsl(var(--chart-${ Object . keys ( config ) . length + 1 } ))` ,
4953 } ;
5054 return config ;
5155 } ,
5256 { } as Record < string , { label : string ; color : string } > ,
5357 ) ;
5458
5559 return (
56- < Card className = "flex h-full flex-col bg-black " >
60+ < Card className = "flex h-full flex-col" >
5761 < CardHeader className = "items-center pb-0" >
58- < CardTitle > { title } </ CardTitle >
59- { /* <CardDescription>All-time status data</CardDescription> */ }
62+ < CardTitle className = "text-lg" > { title } </ CardTitle >
63+ < CardDescription className = "text-center text-sm" >
64+ Distribution of application statuses
65+ </ CardDescription >
6066 </ CardHeader >
6167 < CardContent className = "flex-1 pb-0" >
6268 < ChartContainer
6369 config = { chartConfig }
64- className = "mx-auto aspect-square max-h-[300px ]"
70+ className = "mx-auto aspect-square max-h-[350px ]"
6571 >
6672 < PieChart >
67- < Pie data = { chartData } dataKey = "applicants" />
73+ < Pie
74+ data = { chartData }
75+ dataKey = "applicants"
76+ strokeWidth = { 2 }
77+ />
6878 < ChartLegend
6979 content = { < ChartLegendContent nameKey = "status" /> }
7080 className = "-translate-y-2 flex-wrap gap-2 [&>*]:basis-1/4 [&>*]:justify-center"
0 commit comments