Fix Admin Menu PPID, Submenu IKM

This commit is contained in:
2025-08-13 00:07:57 +08:00
parent c1583c21b1
commit a1d55e2b0a
64 changed files with 2865 additions and 1829 deletions

View File

@@ -87,9 +87,8 @@ function Kepuasan() {
<Flex justify={"space-between"} align={"center"}>
<Text fw={"bold"}>Pelayanan Terhadap Publik Desa Darmasaba</Text>
<Box>
<Text fz={"h1"} fw={"bold"} c={colors["blue-button"]}>95.00</Text>
<Text >Sangat Baik</Text>
<Text fz={"sm"} fw={"bold"} c={colors["blue-button"]}>Total 2500 responden</Text>
<Text fz={"sm"} fw={"bold"} c={colors["blue-button"]}>Total Responden</Text>
<Text fz={"h1"} fw={"bold"} c={colors["blue-button"]}>2500</Text>
</Box>
</Flex>
<BarChart

View File

@@ -0,0 +1,60 @@
import colors from '@/con/colors';
import { Box, Card, Image, Stack, Text } from '@mantine/core';
import React from 'react';
import { Prisma } from '@prisma/client';
interface ProfileViewProps {
data: Prisma.PejabatDesaGetPayload<{ include: { image: true } }> | null;
}
function ProfileView({ data }: ProfileViewProps) {
if (!data) {
return <div>No profile data available</div>;
}
return (
<Stack
justify="end"
align="end"
pos="relative"
w={{
base: "100%",
md: "40%",
}}
px="xl"
>
{data.image?.link && (
<Image
src={data.image.link}
alt={data.name || "Profile image"}
sizes="100%"
fit="contain"
/>
)}
<Box
pos="absolute"
bottom={0}
p={{
base: "xs",
md: "md",
}}
>
<Card
px="lg"
radius="32"
className="glass3"
style={{
border: `1px solid white`,
}}
>
<Text>{data.position}</Text>
<Text c={colors["blue-button"]} fw="bolder" fz="1rem">
{data.name}
</Text>
</Card>
</Box>
</Stack>
);
}
export default ProfileView;

View File

@@ -16,6 +16,7 @@ import {
import { useEffect, useState } from "react";
import ModuleView from "./ModuleView";
import SosmedView from "./SosmedView";
import ProfileView from "./ProfileView";
const getDayOfWeek = () => {
const days = ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'];
@@ -59,6 +60,7 @@ const getWorkStatus = (day: string, currentTime: string): { status: string; mess
function LandingPage() {
const [socialMedia, setSocialMedia] = useState<Prisma.MediaSosialGetPayload<{ include: { image: true } }>[]>([]);
const [profile, setProfile] = useState<Prisma.PejabatDesaGetPayload<{ include: { image: true } }> | null>(null);
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
@@ -87,7 +89,21 @@ function LandingPage() {
}
};
const fetchProfile = async () => {
try {
const response = await fetch(`/api/landingpage/pejabatdesa/edit`);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const result = await response.json();
setProfile(result.data || null); // Handle single object response
} catch (error) {
console.error('Error fetching profile:', error);
setProfile(null);
}
};
fetchSocialMedia();
fetchProfile();
}, []);
const [workStatus, setWorkStatus] = useState<{ status: string; message: string }>
@@ -296,45 +312,13 @@ function LandingPage() {
</Card>
</Stack>
<Stack
justify={"end"}
align={"end"}
pos={"relative"}
w={{
base: "100%",
md: "40%",
}}
px={"xl"}
>
<Image
src={"/assets/images/perbekel.png"}
alt="perbekel"
sizes="100%"
fit="contain"
/>
<Box
pos={"absolute"}
bottom={0}
p={{
base: "xs",
md: "md",
}}
>
<Card
px={"lg"}
radius={"32"}
className="glass3"
style={{
border: `1px solid white`,
}}
>
<Text>Perbekel Desa Darmasaba</Text>
<Text c={colors["blue-button"]} fw={"bolder"} fz={"1rem"}>
I.B. Surya Prabhawa Manuaba, S.H.,M.H.,NL.P.
</Text>
</Card>
</Box>
</Stack>
{isLoading ? (
<Skeleton height={32} width="100%" />
) : profile ? (
<ProfileView data={profile} />
) : (
<div>No profile available</div>
)}
</Flex>
</Stack >
);