11"use client" ;
22
33import { useTotalEmplymentStats } from "@/apis/applications" ;
4- import { useEffect , useState } from "react" ;
4+ import { useEffect } from "react" ;
55import { PieChart , Pie , Cell } from "recharts" ;
66
7- export default function JobPieChart ( ) {
8- const { data : employmentData , isLoading } = useTotalEmplymentStats ( ) ;
7+ export default function JobPieChart ( { year } : { year : number } ) {
8+ const { data : employmentData , isLoading } = useTotalEmplymentStats ( year ) ;
99
1010 const passedCount = employmentData ?. passed_count || 0 ;
1111 const totalStudentCount = employmentData ?. total_student_count || 1 ;
@@ -25,7 +25,32 @@ export default function JobPieChart() {
2525 } ,
2626 ] ;
2727
28- if ( isLoading || ! employmentData ) return null ;
28+ if ( isLoading || ! employmentData ) {
29+ return (
30+ < div className = "flex flex-col items-center bg-[#FFF] rounded-xl pt-[24px] pb-[27px] pr-9 gap-8 border border-[#E5E5E5] animate-pulse" >
31+ < div className = "w-full flex justify-end mb-2" >
32+ < div className = "w-24 h-6 bg-[#eee] rounded" />
33+ </ div >
34+ < div className = "flex flex-col gap-[10px] items-center relative" >
35+ < div className = "w-[160px] h-[160px] rounded-full bg-[#f5f5f5]" />
36+ < div className = "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-center text-b2 font-b text-primaryBlue03" >
37+ --
38+ </ div >
39+ </ div >
40+ < div className = "flex justify-center items-center gap-[34px] w-full" >
41+ < div className = "flex flex-col gap-3 items-center" >
42+ < div className = "w-28 h-4 bg-[#eee] rounded" />
43+ < div className = "w-20 h-6 bg-[#eee] rounded mt-1" />
44+ </ div >
45+ < div className = "w-[1px] h-[26px] bg-[#E5E5E5]" />
46+ < div className = "flex flex-col gap-3 items-center" >
47+ < div className = "w-28 h-4 bg-[#eee] rounded" />
48+ < div className = "w-24 h-6 bg-[#eee] rounded mt-1" />
49+ </ div >
50+ </ div >
51+ </ div >
52+ ) ;
53+ }
2954
3055 return (
3156 < div className = "flex flex-col items-center bg-[#FFF] rounded-xl pt-[24px] pb-[27px] pr-9 gap-8 border border-[#E5E5E5]" >
0 commit comments