"use client"; import { useState } from "react"; import dynamic from "next/dynamic"; import { ApexOptions } from "apexcharts"; import { Card, CardContent } from "@/components/ui/card"; import { Label } from "@/components/ui/label"; import { Input } from "@/components/ui/input"; const Chart = dynamic(() => import("react-apexcharts"), { ssr: false }); export default function SupervisorData() { const [startDate, setStartDate] = useState("2025-10-09"); const [endDate, setEndDate] = useState("2025-10-09"); // ✅ Chart config with proper ApexOptions typing const chartOptions: ApexOptions = { chart: { type: "bar", toolbar: { show: false }, }, plotOptions: { bar: { borderRadius: 4, horizontal: false, columnWidth: "45%", }, }, dataLabels: { enabled: true }, xaxis: { categories: [ "ITWASUM POLRI", "BAINTELKAM POLRI", "BAHARKAM POLRI", "BARESKRIM POLRI", "LEMDIKLAT POLRI", "KORBRIMOB POLRI", "STAMAOPS POLRI", ], labels: { rotate: -45, style: { fontSize: "11px" }, }, }, yaxis: { title: { text: "Total Konten" }, }, grid: { strokeDashArray: 4 }, responsive: [ { breakpoint: 768, options: { plotOptions: { bar: { columnWidth: "60%", }, }, xaxis: { labels: { rotate: -30, style: { fontSize: "9px" } }, }, dataLabels: { enabled: false }, }, }, ], }; const chartDataSatker = [ { name: "Total Konten", data: [9, 8, 7, 6, 5, 4, 3], }, ]; const chartDataMedia = [ { name: "Total Konten", data: [9, 8, 7, 6, 5, 4], }, ]; const chartOptionsMedia: ApexOptions = { ...chartOptions, xaxis: { categories: [ "Media Online", "Media Sosial", "Videotron", "Radio Polri", "TV Polri", "Majalah Digital", ], labels: { rotate: -45, style: { fontSize: "11px" }, }, }, }; return (