Fix Eror Grafik Realisasi-3
This commit is contained in:
@@ -1,17 +1,13 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import { Paper, Title, Progress, Stack, Text, Group, Box } from '@mantine/core';
|
import { Paper, Title, Progress, Stack, Text, Group, Box } from '@mantine/core';
|
||||||
|
|
||||||
interface APBDesItem {
|
interface APBDesItem {
|
||||||
tipe: string;
|
tipe: string | null;
|
||||||
anggaran: number;
|
anggaran: number;
|
||||||
realisasi?: number;
|
realisasi?: number;
|
||||||
totalRealisasi?: number;
|
totalRealisasi?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface APBDesData {
|
|
||||||
tahun?: number;
|
|
||||||
items?: APBDesItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SummaryProps {
|
interface SummaryProps {
|
||||||
title: string;
|
title: string;
|
||||||
data: APBDesItem[];
|
data: APBDesItem[];
|
||||||
@@ -97,9 +93,17 @@ function Summary({ title, data }: SummaryProps) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function GrafikRealisasi({ apbdesData }: { apbdesData: APBDesData }) {
|
export default function GrafikRealisasi({
|
||||||
const items = apbdesData.items || [];
|
apbdesData,
|
||||||
const tahun = apbdesData.tahun || new Date().getFullYear();
|
}: {
|
||||||
|
apbdesData: {
|
||||||
|
tahun?: number | null;
|
||||||
|
items?: APBDesItem[] | null;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
}) {
|
||||||
|
const items = apbdesData?.items || [];
|
||||||
|
const tahun = apbdesData?.tahun || new Date().getFullYear();
|
||||||
|
|
||||||
const pendapatan = items.filter((i: APBDesItem) => i.tipe === 'pendapatan');
|
const pendapatan = items.filter((i: APBDesItem) => i.tipe === 'pendapatan');
|
||||||
const belanja = items.filter((i: APBDesItem) => i.tipe === 'belanja');
|
const belanja = items.filter((i: APBDesItem) => i.tipe === 'belanja');
|
||||||
|
|||||||
Reference in New Issue
Block a user