From 84b96ca3be23204f3e65c3d9b197dd62bd09c115 Mon Sep 17 00:00:00 2001 From: nico Date: Wed, 25 Mar 2026 00:09:38 +0800 Subject: [PATCH] Refactor New Ui Bumdes --- src/components/bumdes-page.tsx | 389 +----------------- src/components/demografi-pekerjaan.tsx | 8 +- src/components/jenna-analytic.tsx | 4 +- src/components/keuangan-anggaran.tsx | 35 +- src/components/kinerja-divisi.tsx | 7 +- .../kinerja-divisi/activity-card.tsx | 4 +- src/components/pengaduan-layanan-publik.tsx | 2 +- src/components/sidebar.tsx | 5 +- src/components/umkm/header-toggle.tsx | 75 ++++ src/components/umkm/produk-unggulan.tsx | 100 +++++ src/components/umkm/sales-table.tsx | 260 ++++++++++++ src/components/umkm/summary-cards.tsx | 144 +++++++ src/components/umkm/top-products.tsx | 140 +++++++ src/routes/bantuan.tsx | 2 +- src/routes/bumdes.tsx | 2 +- src/routes/keamanan.tsx | 2 +- src/store/umkm.ts | 30 ++ 17 files changed, 797 insertions(+), 412 deletions(-) create mode 100644 src/components/umkm/header-toggle.tsx create mode 100644 src/components/umkm/produk-unggulan.tsx create mode 100644 src/components/umkm/sales-table.tsx create mode 100644 src/components/umkm/summary-cards.tsx create mode 100644 src/components/umkm/top-products.tsx create mode 100644 src/store/umkm.ts diff --git a/src/components/bumdes-page.tsx b/src/components/bumdes-page.tsx index 4b7e1b2..9354293 100644 --- a/src/components/bumdes-page.tsx +++ b/src/components/bumdes-page.tsx @@ -1,385 +1,38 @@ -import { - Badge, - Button, - Card, - Grid, - GridCol, - Group, - Select, - Stack, - Table, - Text, - Title, - useMantineColorScheme, -} from "@mantine/core"; -import { - IconBuildingStore, - IconCategory, - IconCurrency, - IconUsers, -} from "@tabler/icons-react"; -import { useState } from "react"; +import { Grid, GridCol, Stack } from "@mantine/core"; +import { HeaderToggle } from "./umkm/header-toggle"; +import { ProdukUnggulan } from "./umkm/produk-unggulan"; +import type { SalesData } from "./umkm/sales-table"; +import { SalesTable } from "./umkm/sales-table"; +import { SummaryCards } from "./umkm/summary-cards"; +import { TopProducts } from "./umkm/top-products"; const BumdesPage = () => { - const { colorScheme } = useMantineColorScheme(); - const dark = colorScheme === "dark"; - - const [timeFilter, setTimeFilter] = useState("bulan"); - - // Sample data for KPI cards - const kpiData = [ - { - title: "UMKM Aktif", - value: 45, - icon: , - color: "darmasaba-blue", - }, - { - title: "UMKM Terdaftar", - value: 68, - icon: , - color: "darmasaba-success", - }, - { - title: "Omzet", - value: "Rp 48.000.000", - icon: , - color: "darmasaba-warning", - }, - { - title: "Kategori UMKM", - value: 34, - icon: , - color: "darmasaba-danger", - }, - ]; - - // Sample data for top products - const topProducts = [ - { - rank: 1, - name: "Beras Premium Organik", - umkmOwner: "Warung Pak Joko", - growth: "+12%", - }, - { - rank: 2, - name: "Keripik Singkong", - umkmOwner: "Ibu Sari Snack", - growth: "+8%", - }, - { - rank: 3, - name: "Madu Alami", - umkmOwner: "Peternakan Lebah", - growth: "+5%", - }, - ]; - - // Sample data for product sales - const productSales = [ - { - produk: "Beras Premium Organik", - penjualanBulanIni: "Rp 8.500.000", - bulanLalu: "Rp 8.500.000", - trend: 10, - volume: "650 Kg", - stok: "850 Kg", - }, - { - produk: "Keripik Singkong", - penjualanBulanIni: "Rp 4.200.000", - bulanLalu: "Rp 3.800.000", - trend: 10, - volume: "320 Kg", - stok: "120 Kg", - }, - { - produk: "Madu Alami", - penjualanBulanIni: "Rp 3.750.000", - bulanLalu: "Rp 4.100.000", - trend: -8, - volume: "150 Liter", - stok: "45 Liter", - }, - { - produk: "Kecap Tradisional", - penjualanBulanIni: "Rp 2.800.000", - bulanLalu: "Rp 2.500.000", - trend: 12, - volume: "280 Botol", - stok: "95 Botol", - }, - ]; + const handleDetailClick = (product: SalesData) => { + console.log("Detail clicked for:", product); + // TODO: Open modal or navigate to detail page + }; return ( - {/* KPI Cards */} - - {kpiData.map((kpi, index) => ( - - - - - - {kpi.title} - - - {typeof kpi.value === "number" - ? kpi.value.toLocaleString() - : kpi.value} - - - - {kpi.icon} - - - - - ))} - + {/* KPI Summary Cards */} + - {/* Update Penjualan Produk Header */} - - - - Update Penjualan Produk - - - - - - - + {/* Header with Time Range Toggle */} + + {/* Main Content - 2 Column Layout */} - {/* Produk Unggulan (Left Column) */} + {/* Left Panel - Produk Unggulan */} - {/* Total Penjualan, Produk Aktif, Total Transaksi */} - - - - - Total Penjualan - - - Rp 28.500.000 - - - - - Produk Aktif - - - 124 Produk - - - - - Total Transaksi - - - 1.240 Transaksi - - - - - - {/* Top 3 Produk Terlaris */} - - - Top 3 Produk Terlaris - - - {topProducts.map((product) => ( - - - - {product.rank} - - - - {product.name} - - - {product.umkmOwner} - - - - - {product.growth} - - - ))} - - + + - {/* Detail Penjualan Produk (Right Column) */} + {/* Right Panel - Detail Penjualan Produk */} - - - - Detail Penjualan Produk - - +