Fix QC Kak Inno Admin, Fix QC Keano UI User, Fix QC Pak jun tabel apbdes
This commit is contained in:
@@ -339,7 +339,7 @@ function Kepuasan() {
|
||||
label="Nama"
|
||||
type='text'
|
||||
placeholder="Masukkan nama"
|
||||
defaultValue={state.create.form.name}
|
||||
value={state.create.form.name}
|
||||
onChange={(val) => {
|
||||
state.create.form.name = val.currentTarget.value;
|
||||
}}
|
||||
@@ -348,7 +348,7 @@ function Kepuasan() {
|
||||
label="Tanggal"
|
||||
type="date"
|
||||
placeholder="masukkan tanggal"
|
||||
defaultValue={state.create.form.tanggal}
|
||||
value={state.create.form.tanggal}
|
||||
onChange={(val) => {
|
||||
state.create.form.tanggal = val.currentTarget.value;
|
||||
}}
|
||||
@@ -357,7 +357,7 @@ function Kepuasan() {
|
||||
key={"jenisKelamin"}
|
||||
label={"Jenis Kelamin"}
|
||||
placeholder={indeksKepuasanState.jenisKelaminResponden.findMany.loading ? 'Memuat...' : 'Pilih jenis kelamin'}
|
||||
defaultValue={state.create.form.jenisKelaminId || ""}
|
||||
value={state.create.form.jenisKelaminId || ""}
|
||||
onChange={(val) => {
|
||||
state.create.form.jenisKelaminId = val ?? "";
|
||||
}}
|
||||
@@ -375,7 +375,7 @@ function Kepuasan() {
|
||||
key={"rating_responden"}
|
||||
label={"Rating"}
|
||||
placeholder={indeksKepuasanState.pilihanRatingResponden.findMany.loading ? 'Memuat...' : 'Pilih rating'}
|
||||
defaultValue={state.create.form.ratingId || ""}
|
||||
value={state.create.form.ratingId || ""}
|
||||
onChange={(val) => {
|
||||
state.create.form.ratingId = val ?? "";
|
||||
}}
|
||||
@@ -393,7 +393,7 @@ function Kepuasan() {
|
||||
key={"kelompokUmur"}
|
||||
label={"Kelompok Umur"}
|
||||
placeholder={indeksKepuasanState.kelompokUmurResponden.findMany.loading ? 'Memuat...' : 'Pilih kelompok umur'}
|
||||
defaultValue={state.create.form.kelompokUmurId || ""}
|
||||
value={state.create.form.kelompokUmurId || ""}
|
||||
onChange={(val) => {
|
||||
state.create.form.kelompokUmurId = val ?? "";
|
||||
}}
|
||||
@@ -611,7 +611,7 @@ function Kepuasan() {
|
||||
label="Nama"
|
||||
type='text'
|
||||
placeholder="masukkan nama"
|
||||
defaultValue={state.create.form.name}
|
||||
value={state.create.form.name}
|
||||
onChange={(val) => {
|
||||
state.create.form.name = val.currentTarget.value;
|
||||
}}
|
||||
@@ -620,7 +620,7 @@ function Kepuasan() {
|
||||
label="Tanggal Pengisian"
|
||||
type="date"
|
||||
placeholder="masukkan tanggal"
|
||||
defaultValue={state.create.form.tanggal}
|
||||
value={state.create.form.tanggal}
|
||||
onChange={(val) => {
|
||||
state.create.form.tanggal = val.currentTarget.value;
|
||||
}}
|
||||
@@ -629,7 +629,7 @@ function Kepuasan() {
|
||||
key={"jenisKelamin"}
|
||||
label={"Jenis Kelamin"}
|
||||
placeholder={indeksKepuasanState.jenisKelaminResponden.findMany.loading ? 'Memuat...' : 'Pilih jenis kelamin'}
|
||||
defaultValue={state.create.form.jenisKelaminId || ""}
|
||||
value={state.create.form.jenisKelaminId || ""}
|
||||
onChange={(val) => {
|
||||
state.create.form.jenisKelaminId = val ?? "";
|
||||
}}
|
||||
@@ -647,7 +647,7 @@ function Kepuasan() {
|
||||
key={"rating_responden"}
|
||||
label={"Rating"}
|
||||
placeholder={indeksKepuasanState.pilihanRatingResponden.findMany.loading ? 'Memuat...' : 'Pilih rating'}
|
||||
defaultValue={state.create.form.ratingId || ""}
|
||||
value={state.create.form.ratingId || ""}
|
||||
onChange={(val) => {
|
||||
state.create.form.ratingId = val ?? "";
|
||||
}}
|
||||
@@ -665,7 +665,7 @@ function Kepuasan() {
|
||||
key={"kelompokUmur"}
|
||||
label={"Kelompok Umur"}
|
||||
placeholder={indeksKepuasanState.kelompokUmurResponden.findMany.loading ? 'Memuat...' : 'Pilih kelompok umur'}
|
||||
defaultValue={state.create.form.kelompokUmurId || ""}
|
||||
value={state.create.form.kelompokUmurId || ""}
|
||||
onChange={(val) => {
|
||||
state.create.form.kelompokUmurId = val ?? "";
|
||||
}}
|
||||
|
||||
@@ -18,14 +18,10 @@ import {
|
||||
} from "@mantine/core";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { IconCalendarTime, IconInfoCircle } from "@tabler/icons-react";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import ModuleView from "./ModuleView";
|
||||
import ProfileView from "./ProfileView";
|
||||
import SosmedView from "./SosmedView";
|
||||
import { useProxy } from "valtio/utils";
|
||||
import stateDashboardBerita from "@/app/admin/(dashboard)/_state/desa/berita";
|
||||
import stateDesaPengumuman from "@/app/admin/(dashboard)/_state/desa/pengumuman";
|
||||
import ModernNewsNotification from "../../ModernNeewsNotification";
|
||||
|
||||
const getDayOfWeek = () => {
|
||||
const days = ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"];
|
||||
@@ -72,57 +68,7 @@ function LandingPage() {
|
||||
>(null);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
|
||||
const featured = useProxy(stateDashboardBerita.berita.findFirst);
|
||||
const loadingFeatured = featured.loading;
|
||||
const pengumuman = useProxy(stateDesaPengumuman.pengumuman.findFirst);
|
||||
const loadingPengumuman = pengumuman.loading;
|
||||
|
||||
useEffect(() => {
|
||||
if (!featured.data && !loadingFeatured) {
|
||||
stateDashboardBerita.berita.findFirst.load();
|
||||
}
|
||||
}, [featured.data, loadingFeatured]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!pengumuman.data && !loadingPengumuman) {
|
||||
stateDesaPengumuman.pengumuman.findFirst.load();
|
||||
}
|
||||
}, [pengumuman.data, loadingPengumuman]);
|
||||
|
||||
// Transform data untuk notification system
|
||||
const newsData = useMemo(() => {
|
||||
const items = [];
|
||||
|
||||
if (featured.data) {
|
||||
items.push({
|
||||
id: String(featured.data.id || "berita-1"),
|
||||
type: "berita" as const,
|
||||
title: String(featured.data.judul || "Berita Terbaru"),
|
||||
content: String(featured.data.content || ""),
|
||||
timestamp: featured.data.createdAt
|
||||
? (typeof featured.data.createdAt === 'string'
|
||||
? featured.data.createdAt
|
||||
: new Date(featured.data.createdAt).toISOString())
|
||||
: new Date().toISOString(),
|
||||
});
|
||||
}
|
||||
|
||||
if (pengumuman.data) {
|
||||
items.push({
|
||||
id: String(pengumuman.data.id || "pengumuman-1"),
|
||||
type: "pengumuman" as const,
|
||||
title: String(pengumuman.data.judul || "Pengumuman Penting"),
|
||||
content: String(pengumuman.data.content || ""),
|
||||
timestamp: pengumuman.data.createdAt
|
||||
? (typeof pengumuman.data.createdAt === 'string'
|
||||
? pengumuman.data.createdAt
|
||||
: new Date(pengumuman.data.createdAt).toISOString())
|
||||
: new Date().toISOString(),
|
||||
});
|
||||
}
|
||||
|
||||
return items;
|
||||
}, [featured.data, pengumuman.data]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const fetchSocialMedia = async () => {
|
||||
@@ -272,11 +218,6 @@ function LandingPage() {
|
||||
)}
|
||||
</Flex>
|
||||
|
||||
{/* Modern Notification System */}
|
||||
<ModernNewsNotification
|
||||
news={newsData}
|
||||
autoShowDelay={2000} // Muncul 2 detik setelah load
|
||||
/>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user