diff --git a/resources/js/pages/dashboard.tsx b/resources/js/pages/dashboard.tsx index d21463f..67f0eef 100644 --- a/resources/js/pages/dashboard.tsx +++ b/resources/js/pages/dashboard.tsx @@ -1,22 +1,25 @@ import { DatePickerWithRange } from "@/components/Dashboard/DatePicker"; import AuthenticatedLayout from "@/layouts/authenticated-layout"; -import { Head } from "@inertiajs/react"; +import { Head, usePage } from "@inertiajs/react"; import { Building, School, - Skull, UsersRound, Waves, - TrendingUp, + Skull, ArrowUpRight, ArrowDownRight, + TrendingUp, Activity, } from "lucide-react"; -import StatsCard from "@/components/Dashboard/DashCard"; -import { ChartCard } from "@/components/Dashboard/ChartCard"; import { Card } from "@/components/ui/card"; +import hasAnyPermission from "@/utils/hasAnyPermission"; +import { ChartCard } from "@/components/Dashboard/ChartCard"; export default function Dashboard() { + const { auth, runPosts } = usePage().props; + const userPermissions = auth?.user?.permissions ?? []; + return ( @@ -28,18 +31,15 @@ export default function Dashboard() {

Dashboard Overview

- {/*

- Detailed monitoring and analytics of environmental - metrics -

*/} - {/* Stats Cards Grid */} + {/* Stats Section */}
+ {/* Total Laporan (Cek Permission) */} + {/* {hasAnyPermission(userPermissions, ["Dashboard.index"]) && ( */} -
@@ -58,9 +58,10 @@ export default function Dashboard() {
+ {/* )} */} + {/* Jumlah Perusahaan */} -
@@ -80,8 +81,8 @@ export default function Dashboard() {
+ {/* Jumlah Verifikator */} -
@@ -101,8 +102,8 @@ export default function Dashboard() {
+ {/* Air Limbah */} -
@@ -122,8 +123,8 @@ export default function Dashboard() {
+ {/* Limbah B3 */} -
@@ -146,8 +147,7 @@ export default function Dashboard() { {/* Cerobong Stats Section */} -
-
+
@@ -164,15 +164,10 @@ export default function Dashboard() {

2,336

-
- Seluruh Perusahaan -
- - {/* Chart Section */}
diff --git a/resources/js/pages/dashboard_admin.tsx b/resources/js/pages/dashboard_admin.tsx new file mode 100644 index 0000000..67f0eef --- /dev/null +++ b/resources/js/pages/dashboard_admin.tsx @@ -0,0 +1,177 @@ +import { DatePickerWithRange } from "@/components/Dashboard/DatePicker"; +import AuthenticatedLayout from "@/layouts/authenticated-layout"; +import { Head, usePage } from "@inertiajs/react"; +import { + Building, + School, + UsersRound, + Waves, + Skull, + ArrowUpRight, + ArrowDownRight, + TrendingUp, + Activity, +} from "lucide-react"; +import { Card } from "@/components/ui/card"; +import hasAnyPermission from "@/utils/hasAnyPermission"; +import { ChartCard } from "@/components/Dashboard/ChartCard"; + +export default function Dashboard() { + const { auth, runPosts } = usePage().props; + const userPermissions = auth?.user?.permissions ?? []; + + return ( + + + +
+ {/* Top Section */} +
+
+

+ Dashboard Overview +

+
+ +
+ + {/* Stats Section */} +
+ {/* Total Laporan (Cek Permission) */} + {/* {hasAnyPermission(userPermissions, ["Dashboard.index"]) && ( */} + +
+
+
+ +
+
+ + +12.5% +
+
+
+

+ Total Laporan +

+

1,305

+
+
+
+ {/* )} */} + + {/* Jumlah Perusahaan */} + +
+
+
+ +
+
+ + +8.2% +
+
+
+

+ Jumlah Perusahaan +

+

847

+
+
+
+ + {/* Jumlah Verifikator */} + +
+
+
+ +
+
+ + -3.1% +
+
+
+

+ Jumlah Verifikator +

+

124

+
+
+
+ + {/* Air Limbah */} + +
+
+
+ +
+
+ + +5.7% +
+
+
+

+ Air Limbah +

+

2,431

+
+
+
+ + {/* Limbah B3 */} + +
+
+
+ +
+
+ + -2.3% +
+
+
+

+ Limbah B3 +

+

567

+
+
+
+
+ + {/* Cerobong Stats Section */} + +
+
+
+
+ +
+
+

+ Total Cerobong +

+

+ Update terakhir: Senin, 03 Feb 2025 +

+
+
+
+

2,336

+
+
+
+
+
+ +
+
+
+ ); +} diff --git a/resources/js/pages/dashboard_other.tsx b/resources/js/pages/dashboard_other.tsx new file mode 100644 index 0000000..ed3d1ab --- /dev/null +++ b/resources/js/pages/dashboard_other.tsx @@ -0,0 +1,39 @@ +import { DatePickerWithRange } from "@/components/Dashboard/DatePicker"; +import AuthenticatedLayout from "@/layouts/authenticated-layout"; +import { Head, usePage } from "@inertiajs/react"; +import { + Building, + School, + UsersRound, + Waves, + Skull, + ArrowUpRight, + ArrowDownRight, + TrendingUp, + Activity, +} from "lucide-react"; +import { Card } from "@/components/ui/card"; +import hasAnyPermission from "@/utils/hasAnyPermission"; +import { ChartCard } from "@/components/Dashboard/ChartCard"; + +export default function Dashboard() { + const { auth, runPosts } = usePage().props; + const userPermissions = auth?.user?.permissions ?? []; + + return ( + + + +
+ {/* Top Section */} +
+
+

+ Selamat Datang, {auth.user?.name} 🫡 +

+
+
+
+
+ ); +} diff --git a/resources/js/pages/dashboard_perusahaan.tsx b/resources/js/pages/dashboard_perusahaan.tsx new file mode 100644 index 0000000..acd8eba --- /dev/null +++ b/resources/js/pages/dashboard_perusahaan.tsx @@ -0,0 +1,258 @@ +import { DatePickerWithRange } from "@/components/Dashboard/DatePicker"; +import AuthenticatedLayout from "@/layouts/authenticated-layout"; +import { Head, usePage, Link } from "@inertiajs/react"; +import { + Building, + School, + UsersRound, + Waves, + Skull, + ArrowUpRight, + ArrowDownRight, + TrendingUp, + Activity, + FileText, + Volume2, + Box, + Ban, +} from "lucide-react"; +import { Card } from "@/components/ui/card"; +import hasAnyPermission from "@/utils/hasAnyPermission"; +import { ChartCard } from "@/components/Dashboard/ChartCard"; + +export default function Dashboard() { + const { auth, runPosts } = usePage().props; + const userPermissions = auth?.user?.permissions ?? []; + + return ( + + + +
+ {/* Top Section */} +
+
+

+ Dashboard Overview +

+
+ +
+ + {/* Stats Section */} +
+ {/* Izin Lingkungan */} + +
+
+
+ +
+
+

13.00

+

+ Izin Lingkungan +

+
+
+
+ + KE PELAPORAN - TRIWULAN 2/SEMESTER 1 - 2025 + +
+ + {/* Air Limbah */} + +
+
+
+ +
+
+

62.67

+

+ Air Limbah +

+
+
+
+ + KE PELAPORAN - TRIWULAN 1 - 2025 + +
+ + {/* Limbah B3 */} + +
+
+
+ +
+
+

0.00

+

+ Limbah B3 +

+
+
+
+ + KE PELAPORAN - TRIWULAN 1 - 2025 + +
+ + {/* Sumber Bergerak */} + +
+
+
+ +
+
+

0.00

+

+ Sumber Bergerak +

+
+
+
+ + KE PELAPORAN - TRIWULAN 2/SEMESTER 1 - 2025 + +
+ + {/* Kebisingan */} + +
+
+
+ +
+
+

0.00

+

+ Kebisingan +

+
+
+
+ + KE PELAPORAN - TRIWULAN 2/SEMESTER 1 - 2025 + +
+ + {/* Sumber Tidak Bergerak */} + +
+
+
+ +
+
+

0.00

+

+ Sumber Tidak Bergerak +

+
+
+
+ + KE PELAPORAN - TRIWULAN 2/SEMESTER 1 - 2025 + +
+ + {/* Limbah Padat */} + +
+
+
+ +
+
+

0.00

+

+ Limbah Padat +

+
+
+
+ + KE PELAPORAN - TRIWULAN 2/SEMESTER 1 - 2025 + +
+ + {/* Kawasan Dilarang Merokok */} + +
+
+
+ +
+
+

0.00

+

+ Kawasan Dilarang Merokok +

+
+
+
+ + KE PELAPORAN - TRIWULAN 2/SEMESTER 1 - 2025 + +
+
+ + {/* Cerobong Stats Section */} + +
+
+
+
+ +
+
+

+ Total Cerobong +

+

+ Update terakhir: Senin, 03 Feb 2025 +

+
+
+
+

2,336

+
+
+
+
+
+ +
+
+
+ ); +}