/* eslint-disable react-hooks/set-state-in-effect */ import { useState, useEffect } from "react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from "recharts"; interface LandAllocationChartProps { pieChartData: Array<{ name: string; value: number; color: string; }>; } export function LandAllocationChart({ pieChartData }: LandAllocationChartProps) { const [isMounted, setIsMounted] = useState(false); useEffect(() => { setIsMounted(true); }, []); return ( Land Status Breakdown Acreage and share representation of registered parcels by ownership status. {pieChartData.length > 0 ? ( <>
{!isMounted ? (
) : ( {pieChartData.map((entry, index) => ( ))} )}
{pieChartData.map((d, index) => (
{d.name} {d.value} Hectares
))}
) : (

Belum ada data poligon lahan.

)} ); }