From fc387fe8e6a7eba696cbca27d9303fb31ab5da96 Mon Sep 17 00:00:00 2001 From: amaliadwiy Date: Tue, 13 Jan 2026 15:38:29 +0800 Subject: [PATCH] fix: menu setting deskiripsi: - navigate - list length No Issues --- src/components/DesaSetting.tsx | 2 +- src/components/KategoriPelayananSurat.tsx | 8 +++----- src/pages/scr/dashboard/setting/detail_setting_page.tsx | 5 +++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/DesaSetting.tsx b/src/components/DesaSetting.tsx index b5361b1..39bf3f4 100644 --- a/src/components/DesaSetting.tsx +++ b/src/components/DesaSetting.tsx @@ -207,7 +207,7 @@ export default function DesaSetting({ - {list?.map((v: any) => ( + {list.length > 0 && list?.map((v: any) => ( {v.name} diff --git a/src/components/KategoriPelayananSurat.tsx b/src/components/KategoriPelayananSurat.tsx index f39ba3e..6c0b5a2 100644 --- a/src/components/KategoriPelayananSurat.tsx +++ b/src/components/KategoriPelayananSurat.tsx @@ -4,19 +4,17 @@ import { Button, Divider, Flex, - Grid, Group, - Input, List, Modal, Stack, Table, Text, Title, - Tooltip, + Tooltip } from "@mantine/core"; import { useDisclosure, useShallowEffect } from "@mantine/hooks"; -import { IconEdit, IconEye, IconPlus, IconTrash } from "@tabler/icons-react"; +import { IconEye, IconTrash } from "@tabler/icons-react"; import type { JsonValue } from "generated/prisma/runtime/library"; import { useState } from "react"; import useSWR from "swr"; @@ -625,7 +623,7 @@ export default function KategoriPelayananSurat({ - {list?.map((v: any) => ( + {list.length > 0 && list?.map((v: any) => ( {v.name} diff --git a/src/pages/scr/dashboard/setting/detail_setting_page.tsx b/src/pages/scr/dashboard/setting/detail_setting_page.tsx index b16fc8c..6434491 100644 --- a/src/pages/scr/dashboard/setting/detail_setting_page.tsx +++ b/src/pages/scr/dashboard/setting/detail_setting_page.tsx @@ -18,12 +18,13 @@ import { import type { JsonValue } from "generated/prisma/runtime/library"; import _ from "lodash"; import { useEffect, useState } from "react"; -import { useLocation } from "react-router-dom"; +import { useLocation, useNavigate } from "react-router-dom"; export default function DetailSettingPage() { const { search } = useLocation(); const query = new URLSearchParams(search); const type = query.get("type"); + const navigate = useNavigate(); const [permissions, setPermissions] = useState([]); const dataMenu = [ { title: "Dashboard", link: "/scr/dashboard/dashboard-home", active: false }, @@ -114,7 +115,7 @@ export default function DetailSettingPage() { .map((item) => ( {navigate("?type=" + item.path)}} label={item.label} leftSection={item.icon} active={