diff --git a/app/components/layoutpengelola/sidebar.tsx b/app/components/layoutpengelola/sidebar.tsx index 0a3172c..f6e45b2 100644 --- a/app/components/layoutpengelola/sidebar.tsx +++ b/app/components/layoutpengelola/sidebar.tsx @@ -129,54 +129,15 @@ const operationalMenuItems: MenuItem[] = [ title: "Transaksi & Pembayaran", icon: , children: [ - { title: "Transaksi Hari Ini", href: "/pengelola/transactions/today" }, { - title: "Pembayaran Tertunda", - href: "/pengelola/transactions/pending", - badge: "urgent" - }, - { - title: "Verifikasi Pembayaran", - href: "/pengelola/transactions/verification" - }, - { title: "Riwayat Transaksi", href: "/pengelola/transactions/history" }, - { title: "Rekap Harian", href: "/pengelola/transactions/daily-recap" } + title: "Transaksi Hari Ini", + href: "/pengelola/dashboard/transactions" + } ] } ]; const fieldMenuItems: MenuItem[] = [ - { - title: "Area Coverage", - icon: , - children: [ - { title: "Peta Operasional", href: "/pengelola/coverage/map" }, - { title: "Rute Pengumpulan", href: "/pengelola/coverage/routes" }, - { - title: "Titik Pengumpulan", - href: "/pengelola/coverage/collection-points" - }, - { - title: "Area Prioritas", - href: "/pengelola/coverage/priority-areas", - badge: "new" - } - ] - }, - { - title: "Penjadwalan", - icon: , - children: [ - { title: "Jadwal Mingguan", href: "/pengelola/schedule/weekly" }, - { title: "Pengepul On-duty", href: "/pengelola/schedule/on-duty" }, - { title: "Shift Management", href: "/pengelola/schedule/shifts" }, - { - title: "Emergency Pickup", - href: "/pengelola/schedule/emergency", - badge: "urgent" - } - ] - }, { title: "Komunikasi", icon: , @@ -185,76 +146,20 @@ const fieldMenuItems: MenuItem[] = [ { title: "Broadcast Message", href: "/pengelola/dashboard/broadcast" - }, - { - title: "Notifikasi Operasional", - href: "/pengelola/dashboard/notifications" - }, - { - title: "Support Ticket", - href: "/pengelola/dashboard/support", - badge: "urgent" } ] - }, - { - title: "Task Management", - icon: , - children: [ - { title: "Task Harian", href: "/pengelola/tasks/daily", badge: "urgent" }, - { title: "Checklist Operasi", href: "/pengelola/tasks/checklist" }, - { title: "Follow-up Required", href: "/pengelola/tasks/followup" }, - { title: "Completed Tasks", href: "/pengelola/tasks/completed" } - ] } ]; const reportingMenuItems: MenuItem[] = [ - { - title: "Laporan Operasional", - icon: , - children: [ - { title: "Laporan Harian", href: "/pengelola/reports/daily" }, - { title: "Laporan Mingguan", href: "/pengelola/reports/weekly" }, - { title: "Performa Tim", href: "/pengelola/reports/team-performance" }, - { title: "Analisis Trend", href: "/pengelola/reports/trends" } - ] - }, - { - title: "Monitoring Kinerja", - icon: , - children: [ - { title: "KPI Dashboard", href: "/pengelola/kpi/dashboard" }, - { title: "Target Achievement", href: "/pengelola/kpi/targets" }, - { title: "Efficiency Metrics", href: "/pengelola/kpi/efficiency" }, - { title: "Quality Metrics", href: "/pengelola/kpi/quality" } - ] - }, - { - title: "Alerts & Issues", - icon: , - children: [ - { - title: "Alert Aktif", - href: "/pengelola/alerts/active", - badge: "urgent" - }, - { title: "Issue Tracking", href: "/pengelola/alerts/issues" }, - { title: "Maintenance Schedule", href: "/pengelola/alerts/maintenance" }, - { title: "Escalation Log", href: "/pengelola/alerts/escalation" } - ] - }, { title: "Pengaturan", icon: , children: [ - { title: "Profil Pengelola", href: "/pengelola/settings/profile" }, { - title: "Notifikasi Setting", - href: "/pengelola/settings/notifications" - }, - { title: "Area Tanggung Jawab", href: "/pengelola/settings/area" }, - { title: "Tim & Koordinator", href: "/pengelola/settings/team" } + title: "Profil Pengelola", + href: "/pengelola/dashboard/pengaturan" + } ] } ]; diff --git a/app/routes/pengelola.dashboard.pengaturan.tsx b/app/routes/pengelola.dashboard.pengaturan.tsx new file mode 100644 index 0000000..a623bf5 --- /dev/null +++ b/app/routes/pengelola.dashboard.pengaturan.tsx @@ -0,0 +1,394 @@ +// app/routes/dashboard.settings.tsx +import { + json, + type LoaderFunctionArgs, + type ActionFunctionArgs +} from "@remix-run/node"; +import { Form, useLoaderData, useNavigation } from "@remix-run/react"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle +} from "~/components/ui/card"; +import { Button } from "~/components/ui/button"; +import { Input } from "~/components/ui/input"; +import { Label } from "~/components/ui/label"; +import { Textarea } from "~/components/ui/textarea"; +import { Separator } from "~/components/ui/separator"; +import { Badge } from "~/components/ui/badge"; +import { Building2, MapPin, Save, User } from "lucide-react"; + +// Loader untuk mengambil data profil perusahaan +export async function loader({ request }: LoaderFunctionArgs) { + // Simulasi data - ganti dengan query database Anda + const companyProfile = { + id: "1", + name: "PT. Kelola Sampah Indonesia", + email: "admin@kelolasampah.co.id", + phone: "+62 21 1234 5678", + website: "https://kelolasampah.co.id", + description: + "Perusahaan pengelolaan sampah terpadu dengan fokus pada daur ulang dan pengelolaan limbah yang ramah lingkungan.", + address: { + street: "Jl. Lingkungan Hijau No. 123", + city: "Jakarta", + province: "DKI Jakarta", + postalCode: "12345", + country: "Indonesia" + }, + establishedYear: "2020", + licenseNumber: "LIC-2020-001" + }; + + return json({ companyProfile }); +} + +// Action untuk handle form submission +export async function action({ request }: ActionFunctionArgs) { + const formData = await request.formData(); + const intent = formData.get("intent"); + + if (intent === "updateProfile") { + // Handle update profil perusahaan + const profileData = { + name: formData.get("name"), + email: formData.get("email"), + phone: formData.get("phone"), + website: formData.get("website"), + description: formData.get("description"), + establishedYear: formData.get("establishedYear"), + licenseNumber: formData.get("licenseNumber") + }; + + // Simulasi update - ganti dengan update database Anda + console.log("Updating profile:", profileData); + + return json({ + success: true, + message: "Profil perusahaan berhasil diperbarui" + }); + } + + if (intent === "updateAddress") { + // Handle update alamat + const addressData = { + street: formData.get("street"), + city: formData.get("city"), + province: formData.get("province"), + postalCode: formData.get("postalCode"), + country: formData.get("country") + }; + + // Simulasi update - ganti dengan update database Anda + console.log("Updating address:", addressData); + + return json({ + success: true, + message: "Alamat perusahaan berhasil diperbarui" + }); + } + + return json({ success: false, message: "Invalid action" }); +} + +export default function SettingsPage() { + const { companyProfile } = useLoaderData(); + const navigation = useNavigation(); + + const isSubmitting = navigation.state === "submitting"; + + return ( +
+
+

Pengaturan

+

+ Kelola profil perusahaan dan informasi alamat Anda +

+
+ + {/* Main Grid Layout */} +
+ {/* Left Column - Profil Perusahaan */} +
+ + +
+ + Profil Perusahaan +
+ + Informasi dasar tentang perusahaan pengelola sampah + +
+ +
+ + +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+ +