import { json } from "@remix-run/node"; import { useLoaderData } from "@remix-run/react"; import { Recycle, Plus, Search, Filter, MoreHorizontal, Edit, Trash2, TrendingUp, TrendingDown } from "lucide-react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "~/components/ui/card"; import { Button } from "~/components/ui/button"; import { Input } from "~/components/ui/input"; import { Badge } from "~/components/ui/badge"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "~/components/ui/table"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "~/components/ui/dropdown-menu"; export const loader = async () => { const wasteData = { summary: { totalTypes: 24, totalVolume: 5678, avgPrice: 2500, trending: "up" }, wasteTypes: [ { id: 1, name: "Plastik PET", category: "Plastik", currentPrice: 3000, priceChange: "+5%", volume: 1500, trend: "up", status: "active" }, { id: 2, name: "Kertas HVS", category: "Kertas", currentPrice: 2000, priceChange: "-2%", volume: 2100, trend: "down", status: "active" }, { id: 3, name: "Aluminium", category: "Logam", currentPrice: 8500, priceChange: "+12%", volume: 450, trend: "up", status: "active" }, { id: 4, name: "Plastik HDPE", category: "Plastik", currentPrice: 2800, priceChange: "+3%", volume: 900, trend: "up", status: "active" }, { id: 5, name: "Kertas Karton", category: "Kertas", currentPrice: 1500, priceChange: "0%", volume: 1200, trend: "stable", status: "active" } ] }; return json({ wasteData }); }; export default function WasteManagement() { const { wasteData } = useLoaderData(); return (
{/* Header */}

Manajemen Data Sampah

Kelola jenis sampah, harga, dan volume transaksi

{/* Summary Cards */}
Total Jenis
{wasteData.summary.totalTypes}

jenis sampah terdaftar

Volume Total
{wasteData.summary.totalVolume.toLocaleString()}

kg bulan ini

Rata-rata Harga
Rp {wasteData.summary.avgPrice.toLocaleString()}

per kilogram

Trend Harga {wasteData.summary.trending === "up" ? ( ) : ( )}
Naik

dibanding bulan lalu

{/* Filter and Search */}
Daftar Jenis Sampah Kelola jenis sampah dan harga terkini
Nama Sampah Kategori Harga Saat Ini Perubahan Volume (kg) Status Aksi {wasteData.wasteTypes.map((waste) => ( {waste.name} {waste.category} Rp {waste.currentPrice.toLocaleString()}
{waste.trend === "up" && ( )} {waste.trend === "down" && ( )} {waste.priceChange}
{waste.volume.toLocaleString()} {waste.status === "active" ? "Aktif" : "Nonaktif"} Edit Hapus
))}
); }