import { Badge, Box, Card, Grid, Group, Progress, Stack, Text, ThemeIcon, Title, useMantineColorScheme, } from "@mantine/core"; import { AlertTriangle, CheckCircle, Clock, MessageCircle, TrendingUp, } from "lucide-react"; import { Bar, BarChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts"; // KPI Data const kpiData = [ { id: 1, title: "Interaksi Hari Ini", value: "61", subtitle: "+15% dari kemarin", trend: "positive", icon: MessageCircle, }, { id: 2, title: "Jawaban Otomatis", value: "87%", subtitle: "53 dari 61 interaksi", icon: CheckCircle, }, { id: 3, title: "Belum Ditindak", value: "8", subtitle: "Perlu respon manual", icon: AlertTriangle, }, { id: 4, title: "Waktu Respon", value: "2.3 sec", subtitle: "Rata-rata", icon: Clock, }, ]; // Chart Data const chartData = [ { day: "Sen", total: 45 }, { day: "Sel", total: 62 }, { day: "Rab", total: 38 }, { day: "Kam", total: 75 }, { day: "Jum", total: 58 }, { day: "Sab", total: 32 }, { day: "Min", total: 51 }, ]; // 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 Hours Data 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 JennaAnalytic = () => { const { colorScheme } = useMantineColorScheme(); const dark = colorScheme === "dark"; return ( {/* TOP SECTION - 4 STAT CARDS */} {kpiData.map((item) => ( {item.title} {item.value} {item.trend === "positive" && ( )} {item.subtitle} ))} {/* MAIN CHART - INTERAKSI CHATBOT */} Interaksi Chatbot {/* BOTTOM SECTION - 2 COLUMNS */} {/* LEFT: TOPIK PERTANYAAN TERBANYAK */} Topik Pertanyaan Terbanyak {topTopics.map((item) => ( {item.topic} {item.count}x ))} {/* RIGHT: JAM TERSIBUK */} Jam Tersibuk {busyHours.map((item) => ( {item.period} {item.percentage}% ))} ); }; export default JennaAnalytic;