import React from "react";
import {
Button,
Card,
Badge,
Progress,
Title,
Text,
Group,
Stack,
Grid,
Box,
useMantineColorScheme,
} from "@mantine/core";
import { BarChart } from "@mantine/charts";
// Sample Data
const kpiData = [
{
id: 1,
title: "Interaksi Hari Ini",
value: "61",
delta: "+15% dari kemarin",
deltaType: "positive",
icon: (
),
},
{
id: 2,
title: "Jawaban Otomatis",
value: "87%",
sub: "53 dari 61 interaksi",
icon: (
),
},
{
id: 3,
title: "Belum Ditindak",
value: "8",
sub: "Perlu respon manual",
deltaType: "negative",
icon: (
),
},
{
id: 4,
title: "Waktu Respon",
value: "2.3 sec",
sub: "Rata-rata",
icon: (
),
},
];
const chartData = [
{ day: "Sen", total: 100 },
{ day: "Sel", total: 120 },
{ day: "Rab", total: 90 },
{ day: "Kam", total: 150 },
{ day: "Jum", total: 110 },
{ day: "Sab", total: 80 },
{ day: "Min", total: 130 },
];
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 },
];
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 (
{/* KPI Cards */}
{kpiData.map((kpi) => (
{kpi.title}
{React.cloneElement(kpi.icon, {
className: "h-6 w-6", // Keeping classes for now, can be replaced by Mantine Icon component if available or styled with sx prop
color: "var(--mantine-color-dimmed)", // Set color via prop
})}
{kpi.value}
{kpi.delta && (
{kpi.delta}
)}
{kpi.sub && (
{kpi.sub}
)}
))}
Interaksi Chatbot
{/* Charts and Lists Section */}
{/* Grafik Interaksi Chatbot (now Bar Chart) */}
Jam Tersibuk
{busyHours.map((item, index) => (
{item.period}
{item.percentage}%
))}
{/* Topik Pertanyaan Terbanyak & Jam Tersibuk */}
{/* Topik Pertanyaan Terbanyak */}
Topik Pertanyaan Terbanyak
{topTopics.map((item, index) => (
{item.topic}
{item.count}x
))}
{/* Jam Tersibuk */}
);
}
export default JennaAnalytic;