import { IconAlertTriangle, IconClock, IconMessageChatbot, IconSparkles, } from "@tabler/icons-react"; import { useMantineColorScheme } from "@mantine/core"; import { Bar, BarChart, CartesianGrid, Cell, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts"; const JennaAnalytic = () => { const { colorScheme } = useMantineColorScheme(); const dark = colorScheme === "dark"; // KPI Data const kpiData = [ { id: 1, title: "Interaksi Hari Ini", value: "61", subtitle: "+15% dari kemarin", icon: IconMessageChatbot, }, { id: 2, title: "Jawaban Otomatis", value: "87%", subtitle: "53 dari 61 interaksi", icon: IconSparkles, }, { id: 3, title: "Belum Ditindak", value: "8", subtitle: "Perlu respon manual", icon: IconAlertTriangle, }, { id: 4, title: "Waktu Respon", value: "2.3s", subtitle: "Rata-rata", icon: IconClock, }, ]; // Weekly chatbot interaction data const weeklyData = [ { day: "Sen", interactions: 100 }, { day: "Sel", interactions: 120 }, { day: "Rab", interactions: 90 }, { day: "Kam", interactions: 150 }, { day: "Jum", interactions: 110 }, { day: "Sab", interactions: 80 }, { day: "Min", interactions: 130 }, ]; // Top topics data const topTopics = [ { topic: "Cara mengurus KTP", count: 89 }, { topic: "Syarat Kartu Keluarga", count: 76 }, { topic: "Jadwal Posyandu", count: 64 }, { topic: "Pengaduan jalan rusak", count: 52 }, { topic: "Info program bansos", count: 48 }, ]; // Busy hour distribution const busyHours = [ { period: "Pagi (08–12)", percentage: 30 }, { period: "Siang (12–16)", percentage: 40 }, { period: "Sore (16–20)", percentage: 20 }, { period: "Malam (20–08)", percentage: 10 }, ]; const COLORS = ["#1E3A5F", "#3B82F6", "#60A5FA", "#93C5FD"]; const cardStyle = { backgroundColor: dark ? "#141D34" : "white", border: `1px solid ${dark ? "#141D34" : "white"}`, }; const textStyle = { color: dark ? "white" : "#1F2937", }; const subtitleStyle = { color: dark ? "#9CA3AF" : "#6B7280", }; return (
{/* Row 1: 4 Statistic Cards */}
{kpiData.map((kpi) => (

{kpi.title}

{kpi.value}

{kpi.subtitle}

))}
{/* Row 2: Full Width Weekly Bar Chart */}

Interaksi Chatbot Mingguan

{weeklyData.map((entry, index) => ( ))}
{/* Row 3: Two Insight Cards */}
{/* Left: Frequently Asked Topics */}

Topik Pertanyaan Terbanyak

{topTopics.map((item, index) => (
{item.topic} {item.count}x
))}
{/* Right: Busy Hour Distribution */}

Distribusi Jam Tersibuk

{busyHours.map((item, index) => (
{item.period} {item.percentage}%
))}
); }; export default JennaAnalytic;