testing yuk
This commit is contained in:
@@ -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 IPKBeasiswaData {
|
||||
@@ -161,7 +161,7 @@ export default function IPKBeasiswaChart({ selectedJenisBeasiswa }: Props) {
|
||||
}
|
||||
});
|
||||
|
||||
// Update theme when it changes
|
||||
// Perbarui tema saat berubah
|
||||
useEffect(() => {
|
||||
const currentTheme = theme;
|
||||
setOptions(prev => ({
|
||||
@@ -250,12 +250,12 @@ export default function IPKBeasiswaChart({ selectedJenisBeasiswa }: 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);
|
||||
|
||||
// Process data for chart
|
||||
// Proses data untuk chart
|
||||
const tahunAngkatan = result.map(item => item.tahun_angkatan);
|
||||
const rataRataIPK = result.map(item => item.rata_rata_ipk);
|
||||
|
||||
@@ -272,7 +272,7 @@ export default function IPKBeasiswaChart({ selectedJenisBeasiswa }: 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user