testing yuk

This commit is contained in:
Randa Firman Putra
2025-09-14 16:59:31 +07:00
parent 248fed0d0b
commit 60211ae829
63 changed files with 315 additions and 315 deletions

View File

@@ -6,7 +6,7 @@ import { ApexOptions } from 'apexcharts';
import { useTheme } from 'next-themes';
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
// Dynamically import ApexCharts to avoid SSR issues
// Import ApexCharts secara dinamis untuk menghindari masalah SSR
const Chart = dynamic(() => import('react-apexcharts'), { ssr: false });
interface IPKPrestasiData {
@@ -161,7 +161,7 @@ export default function IPKPrestasiChart({ selectedJenisPrestasi }: Props) {
}
});
// Update theme when it changes
// Perbarui tema saat berubah
useEffect(() => {
const currentTheme = theme;
setOptions(prev => ({
@@ -250,15 +250,15 @@ export default function IPKPrestasiChart({ selectedJenisPrestasi }: Props) {
const result = await response.json();
if (!Array.isArray(result)) {
throw new Error('Invalid data format received from server');
throw new Error('Format data tidak valid diterima dari server');
}
setData(result);
// Sort data by tahun_angkatan in ascending order
// Urutkan data berdasarkan tahun_angkatan secara ascending
const sortedData = [...result].sort((a, b) => a.tahun_angkatan - b.tahun_angkatan);
// Process data for chart
// Proses data untuk chart
const tahunAngkatan = sortedData.map(item => item.tahun_angkatan);
const rataRataIPK = sortedData.map(item => item.rata_rata_ipk);
@@ -275,7 +275,7 @@ export default function IPKPrestasiChart({ selectedJenisPrestasi }: Props) {
}));
} catch (err) {
console.error('Error in fetchData:', err);
setError(err instanceof Error ? err.message : 'An error occurred while fetching data');
setError(err instanceof Error ? err.message : 'Terjadi kesalahan saat mengambil data');
} finally {
setLoading(false);
}