Fix: Event
Deksripsi - Fix notifikasi - Fix load beranda - Fix reload button di admin
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
"use server";
|
||||
|
||||
import { prisma } from "@/app/lib";
|
||||
import _ from "lodash";
|
||||
|
||||
export async function admin_funEventCheckStatus({ id }: { id: string }) {
|
||||
const data = await prisma.event.findUnique({
|
||||
where: {
|
||||
id: id,
|
||||
},
|
||||
select: {
|
||||
EventMaster_Status: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!data)
|
||||
return { status: 400, message: "Id tidak ditemukan", statusName: "" };
|
||||
return {
|
||||
status: 200,
|
||||
message: "Id ditemukan",
|
||||
statusName: _.lowerCase(data.EventMaster_Status?.name),
|
||||
};
|
||||
}
|
||||
@@ -3,10 +3,16 @@
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
|
||||
export default async function adminNotifikasi_getByUserId() {
|
||||
export default async function adminNotifikasi_getByUserId({page}: {page: number}) {
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
|
||||
const takeData = 10;
|
||||
const skipData = page * takeData - takeData;
|
||||
|
||||
const data = await prisma.notifikasi.findMany({
|
||||
take: takeData,
|
||||
skip: skipData,
|
||||
orderBy: [
|
||||
{
|
||||
isRead: "asc",
|
||||
|
||||
3
src/app_modules/admin/notifikasi/fun/get/index.ts
Normal file
3
src/app_modules/admin/notifikasi/fun/get/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { admin_funEventCheckStatus } from "./fun_event_check_status";
|
||||
|
||||
export { admin_funEventCheckStatus };
|
||||
@@ -2,27 +2,36 @@ import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
||||
import { RouterAdminVote } from "@/app/lib/router_admin/router_admin_vote";
|
||||
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import { admin_funEventCheckStatus } from "../fun/get";
|
||||
import adminNotifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_id";
|
||||
import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
|
||||
|
||||
export async function adminNotifikasi_findRouterEvent({
|
||||
data,
|
||||
router,
|
||||
onChangeNavbar,
|
||||
onToggleNavbar,
|
||||
|
||||
}: {
|
||||
data: MODEL_NOTIFIKASI;
|
||||
router: AppRouterInstance;
|
||||
onChangeNavbar: (val: any) => void;
|
||||
onToggleNavbar: (val: any) => void;
|
||||
|
||||
}) {
|
||||
const path = RouterAdminEvent.table_review
|
||||
const check = await admin_funEventCheckStatus({id: data.appId})
|
||||
|
||||
if (data.status === "Review") {
|
||||
router.push(path, { scroll: false });
|
||||
onChangeNavbar({
|
||||
id: 4,
|
||||
childId: 43,
|
||||
if (check.status == 200) {
|
||||
const udpateReadNotifikasi = await adminNotifikasi_funUpdateIsReadById({
|
||||
notifId: data?.id,
|
||||
});
|
||||
}
|
||||
|
||||
onToggleNavbar(true);
|
||||
if (udpateReadNotifikasi.status == 200) {
|
||||
return {
|
||||
success: true,
|
||||
statusName: check.statusName,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
success: false,
|
||||
statusName: "",
|
||||
};
|
||||
}
|
||||
} else {
|
||||
ComponentAdminGlobal_NotifikasiPeringatan("Status telah dirubah oleh user");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,34 +1,33 @@
|
||||
import { AccentColor } from "@/app_modules/_global/color";
|
||||
import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component";
|
||||
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||
import {
|
||||
Badge,
|
||||
Card,
|
||||
Center,
|
||||
Divider,
|
||||
Group,
|
||||
Paper,
|
||||
Stack,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { IconCheck, IconChecks } from "@tabler/icons-react";
|
||||
gs_adminEventTriggerReview,
|
||||
gs_adminJobTriggerReview,
|
||||
} from "@/app/lib/global_state";
|
||||
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||
import { Center, Loader, Paper, Text } from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { useAtom } from "jotai";
|
||||
import _ from "lodash";
|
||||
import { ScrollOnly } from "next-scroll-loader";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import adminNotifikasi_countNotifikasi from "./fun/count/count_is_read";
|
||||
import adminNotifikasi_getByUserId from "./fun/get/get_notifikasi_by_user_id";
|
||||
import { adminNotifikasi_findRouterEvent } from "./route_setting/event";
|
||||
import { adminNotifikasi_findRouterJob } from "./route_setting/job";
|
||||
import {
|
||||
IAdmin_ActiveChildId,
|
||||
IAdmin_ActivePage,
|
||||
} from "./route_setting/type_of_select_page";
|
||||
import AdminNotifikasi_ViewCardDrawer from "./view_card_drawer";
|
||||
|
||||
export function ComponentAdmin_UIDrawerNotifikasi({
|
||||
newAdminNtf,
|
||||
listNotifikasi,
|
||||
onChangeNavbar,
|
||||
onToggleNavbar,
|
||||
onLoadCountNotif,
|
||||
}: {
|
||||
newAdminNtf: number;
|
||||
listNotifikasi: MODEL_NOTIFIKASI[];
|
||||
onChangeNavbar: (val: {
|
||||
id: IAdmin_ActivePage;
|
||||
@@ -37,107 +36,20 @@ export function ComponentAdmin_UIDrawerNotifikasi({
|
||||
onToggleNavbar: (val: any) => void;
|
||||
onLoadCountNotif: (val: any) => void;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [data, setData] = useState<MODEL_NOTIFIKASI[]>(listNotifikasi);
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [dataId, setDataId] = useState<string>("");
|
||||
const [activePage, setActivePage] = useState<number>(1);
|
||||
|
||||
async function onRead({ data }: { data: MODEL_NOTIFIKASI }) {
|
||||
// JOB
|
||||
if (data?.kategoriApp === "JOB") {
|
||||
const checkJob = await adminNotifikasi_findRouterJob({
|
||||
data: data,
|
||||
});
|
||||
|
||||
if (checkJob?.success) {
|
||||
setVisible(true);
|
||||
setDataId(data.id);
|
||||
|
||||
const loadCountNotif = await adminNotifikasi_countNotifikasi();
|
||||
onLoadCountNotif(loadCountNotif);
|
||||
|
||||
const loadListNotifikasi = await adminNotifikasi_getByUserId();
|
||||
setData(loadListNotifikasi as any);
|
||||
|
||||
if (loadCountNotif && loadListNotifikasi) {
|
||||
onChangeNavbar({
|
||||
id: "Job",
|
||||
childId: "Job_3",
|
||||
});
|
||||
|
||||
const path = `/dev/admin/job/child/${checkJob.statusName}`;
|
||||
|
||||
router.push(path);
|
||||
setVisible(false);
|
||||
setDataId("");
|
||||
}
|
||||
}
|
||||
useShallowEffect(() => {
|
||||
if (newAdminNtf != 0) {
|
||||
onLoadData(setData);
|
||||
}
|
||||
}, [newAdminNtf, setData]);
|
||||
|
||||
// // FORUM
|
||||
// e?.kategoriApp === "FORUM" &&
|
||||
// adminNotifikasi_findRouterForum({
|
||||
// data: e,
|
||||
// router: router,
|
||||
// onChangeNavbar(val) {
|
||||
// onChangeNavbar(val);
|
||||
// },
|
||||
// onToggleNavbar(val) {
|
||||
// onToggleNavbar(val);
|
||||
// },
|
||||
// });
|
||||
|
||||
// // VOTE
|
||||
// e?.kategoriApp === "VOTING" &&
|
||||
// adminNotifikasi_findRouterVoting({
|
||||
// data: e,
|
||||
// router: router,
|
||||
// onChangeNavbar(val) {
|
||||
// onChangeNavbar(val);
|
||||
// },
|
||||
// onToggleNavbar(val) {
|
||||
// onToggleNavbar(val);
|
||||
// },
|
||||
// });
|
||||
|
||||
// // EVENT
|
||||
// e?.kategoriApp === "EVENT" &&
|
||||
// adminNotifikasi_findRouterEvent({
|
||||
// data: e,
|
||||
// router: router,
|
||||
// onChangeNavbar(val) {
|
||||
// onChangeNavbar(val);
|
||||
// },
|
||||
// onToggleNavbar(val) {
|
||||
// onToggleNavbar(val);
|
||||
// },
|
||||
// });
|
||||
|
||||
// // DONASI
|
||||
// e.kategoriApp === "DONASI" &&
|
||||
// adminNotifikasi_findRouterDonasi({
|
||||
// data: e,
|
||||
// router: router,
|
||||
// onChangeNavbar(val) {
|
||||
// onChangeNavbar(val);
|
||||
// },
|
||||
// onToggleNavbar(val) {
|
||||
// onToggleNavbar(val);
|
||||
// },
|
||||
// });
|
||||
|
||||
// // INVESTASI
|
||||
// e.kategoriApp === "INVESTASI" &&
|
||||
// adminNotifikasi_findRouterInvestasi({
|
||||
// data: e,
|
||||
// router: router,
|
||||
// onChangeNavbar(val) {
|
||||
// onChangeNavbar(val);
|
||||
// },
|
||||
// onToggleNavbar(val) {
|
||||
// onToggleNavbar(val);
|
||||
// },
|
||||
// });
|
||||
async function onLoadData(setData: any) {
|
||||
const loadListNotifikasi = await adminNotifikasi_getByUserId({
|
||||
page: activePage,
|
||||
});
|
||||
setData(loadListNotifikasi as any);
|
||||
}
|
||||
|
||||
if (_.isEmpty(data)) {
|
||||
@@ -155,91 +67,42 @@ export function ComponentAdmin_UIDrawerNotifikasi({
|
||||
return (
|
||||
<>
|
||||
<Paper h={"100%"}>
|
||||
<Stack>
|
||||
{data.map((e, i) => (
|
||||
<Card
|
||||
style={{
|
||||
transition: "0.5s",
|
||||
}}
|
||||
c={"white"}
|
||||
key={e?.id}
|
||||
bg={e?.isRead ? "gray" : AccentColor.darkblue}
|
||||
sx={{
|
||||
borderColor: AccentColor.blue,
|
||||
borderStyle: "solid",
|
||||
borderWidth: "2px",
|
||||
":hover": {
|
||||
backgroundColor: AccentColor.blue,
|
||||
borderColor: AccentColor.softblue,
|
||||
borderStyle: "solid",
|
||||
borderWidth: "2px",
|
||||
},
|
||||
}}
|
||||
onClick={async () => {
|
||||
onRead({ data: e });
|
||||
// callBackIsNotifikasi(false);
|
||||
}}
|
||||
>
|
||||
<Card.Section p={"sm"}>
|
||||
<Stack spacing={"xs"}>
|
||||
<Group position="apart">
|
||||
<Text fw={"bold"} fz={10}>
|
||||
# {e?.kategoriApp}
|
||||
</Text>
|
||||
{e?.status ? (
|
||||
<Badge fz={10} size="sm">
|
||||
{e?.status}
|
||||
</Badge>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Group>
|
||||
<Divider color="gray.3" />
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
<Card.Section px={"sm"} pb={"sm"}>
|
||||
<Stack spacing={0}>
|
||||
<Text lineClamp={2} fw={"bold"} fz={"xs"}>
|
||||
{e?.title}
|
||||
</Text>
|
||||
<Text lineClamp={2} fz={"xs"}>
|
||||
{e?.pesan}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
<Card.Section p={"sm"}>
|
||||
<Group position="apart">
|
||||
<Text fz={10}>
|
||||
{new Intl.DateTimeFormat("id-ID", {
|
||||
dateStyle: "long",
|
||||
}).format(e?.createdAt)}
|
||||
<ScrollOnly
|
||||
height="90vh"
|
||||
renderLoading={() => (
|
||||
<Center mt={"lg"}>
|
||||
<Loader color={"yellow"} />
|
||||
</Center>
|
||||
)}
|
||||
data={data}
|
||||
setData={setData}
|
||||
moreData={async () => {
|
||||
const loadData = await adminNotifikasi_getByUserId({
|
||||
page: activePage + 1,
|
||||
});
|
||||
|
||||
<Text span inherit fz={10}>
|
||||
{", "}
|
||||
{new Intl.DateTimeFormat("id-ID", {
|
||||
timeStyle: "short",
|
||||
}).format(e?.createdAt)}
|
||||
</Text>
|
||||
</Text>
|
||||
{e?.isRead ? (
|
||||
<Group spacing={5}>
|
||||
<IconChecks size={10} />
|
||||
<Text fz={10}>Sudah dilihat</Text>
|
||||
</Group>
|
||||
) : (
|
||||
<Group spacing={5}>
|
||||
<IconCheck size={10} />
|
||||
<Text fz={10}>Belum dilihat</Text>
|
||||
</Group>
|
||||
)}
|
||||
</Group>
|
||||
{visible && dataId === e?.id && (
|
||||
<ComponentGlobal_CardLoadingOverlay />
|
||||
)}
|
||||
</Card.Section>
|
||||
</Card>
|
||||
setActivePage((val) => val + 1);
|
||||
|
||||
return loadData;
|
||||
}}
|
||||
>
|
||||
{(item) => (
|
||||
<AdminNotifikasi_ViewCardDrawer
|
||||
data={item}
|
||||
activePage={activePage}
|
||||
onChangeNavbar={(val) => onChangeNavbar(val)}
|
||||
onLoadCountNotif={(val) => onLoadCountNotif(val)}
|
||||
onToggleNavbar={(val) => onToggleNavbar(val)}
|
||||
onLoadDataNotifikasi={(val) => setData(val)}
|
||||
/>
|
||||
)}
|
||||
</ScrollOnly>
|
||||
|
||||
{/* <Stack>
|
||||
{data.map((e, i) => (
|
||||
|
||||
))}
|
||||
</Stack>
|
||||
</Stack> */}
|
||||
</Paper>
|
||||
</>
|
||||
);
|
||||
|
||||
296
src/app_modules/admin/notifikasi/view_card_drawer.tsx
Normal file
296
src/app_modules/admin/notifikasi/view_card_drawer.tsx
Normal file
@@ -0,0 +1,296 @@
|
||||
import {
|
||||
gs_adminJobTriggerReview,
|
||||
gs_adminEventTriggerReview,
|
||||
} from "@/app/lib/global_state";
|
||||
import { AccentColor } from "@/app_modules/_global/color";
|
||||
import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component";
|
||||
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||
import { Card, Stack, Group, Badge, Divider, Text } from "@mantine/core";
|
||||
import { IconChecks, IconCheck } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import adminNotifikasi_countNotifikasi from "./fun/count/count_is_read";
|
||||
import adminNotifikasi_getByUserId from "./fun/get/get_notifikasi_by_user_id";
|
||||
import { adminNotifikasi_findRouterEvent } from "./route_setting/event";
|
||||
import { adminNotifikasi_findRouterJob } from "./route_setting/job";
|
||||
import {
|
||||
IAdmin_ActivePage,
|
||||
IAdmin_ActiveChildId,
|
||||
} from "./route_setting/type_of_select_page";
|
||||
|
||||
export default function AdminNotifikasi_ViewCardDrawer({
|
||||
data,
|
||||
activePage,
|
||||
onChangeNavbar,
|
||||
onToggleNavbar,
|
||||
onLoadCountNotif,
|
||||
onLoadDataNotifikasi,
|
||||
}: {
|
||||
data: MODEL_NOTIFIKASI;
|
||||
activePage: number;
|
||||
onChangeNavbar: (val: {
|
||||
id: IAdmin_ActivePage;
|
||||
childId: IAdmin_ActiveChildId;
|
||||
}) => void;
|
||||
onToggleNavbar: (val: any) => void;
|
||||
onLoadCountNotif: (val: any) => void;
|
||||
onLoadDataNotifikasi: (val: any) => void;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [dataId, setDataId] = useState<string>("");
|
||||
|
||||
// Realtime
|
||||
const [isAdminJob_TriggerReview, setIsAdminJob_TriggerReview] = useAtom(
|
||||
gs_adminJobTriggerReview
|
||||
);
|
||||
const [isAdminEvent_TriggerReview, setIsAdminEvent_TriggerReview] = useAtom(
|
||||
gs_adminEventTriggerReview
|
||||
);
|
||||
|
||||
async function onRead({ data }: { data: MODEL_NOTIFIKASI }) {
|
||||
// JOB
|
||||
if (data?.kategoriApp === "JOB") {
|
||||
const checkJob = await adminNotifikasi_findRouterJob({
|
||||
data: data,
|
||||
});
|
||||
|
||||
if (checkJob?.success) {
|
||||
setVisible(true);
|
||||
setDataId(data.id);
|
||||
|
||||
const loadCountNotif = await adminNotifikasi_countNotifikasi();
|
||||
onLoadCountNotif(loadCountNotif);
|
||||
|
||||
const loadListNotifikasi = await adminNotifikasi_getByUserId({
|
||||
page: activePage,
|
||||
});
|
||||
onLoadDataNotifikasi(loadListNotifikasi as any);
|
||||
|
||||
if (loadCountNotif && loadListNotifikasi) {
|
||||
const path = `/dev/admin/job/child/${checkJob.statusName}`;
|
||||
|
||||
if (checkJob.statusName == "publish") {
|
||||
onChangeNavbar({
|
||||
id: "Job",
|
||||
childId: "Job_2",
|
||||
});
|
||||
}
|
||||
|
||||
if (checkJob.statusName == "review") {
|
||||
onChangeNavbar({
|
||||
id: "Job",
|
||||
childId: "Job_3",
|
||||
});
|
||||
}
|
||||
|
||||
if (checkJob.statusName == "reject") {
|
||||
onChangeNavbar({
|
||||
id: "Job",
|
||||
childId: "Job_4",
|
||||
});
|
||||
}
|
||||
|
||||
setIsAdminJob_TriggerReview(false);
|
||||
router.push(path);
|
||||
setVisible(false);
|
||||
setDataId("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// EVENT
|
||||
if (data.kategoriApp == "EVENT") {
|
||||
const checkEvent = await adminNotifikasi_findRouterEvent({
|
||||
data: data,
|
||||
});
|
||||
|
||||
if (checkEvent?.success) {
|
||||
setVisible(true);
|
||||
setDataId(data.id);
|
||||
|
||||
const loadCountNotif = await adminNotifikasi_countNotifikasi();
|
||||
onLoadCountNotif(loadCountNotif);
|
||||
|
||||
const loadListNotifikasi = await adminNotifikasi_getByUserId({
|
||||
page: activePage,
|
||||
});
|
||||
onLoadDataNotifikasi(loadListNotifikasi as any);
|
||||
|
||||
if (loadCountNotif && loadListNotifikasi) {
|
||||
const path = `/dev/admin/event/table/${checkEvent.statusName}`;
|
||||
|
||||
if (checkEvent.statusName == "publish") {
|
||||
onChangeNavbar({
|
||||
id: "Event",
|
||||
childId: "Event_2",
|
||||
});
|
||||
}
|
||||
|
||||
if (checkEvent.statusName == "review") {
|
||||
onChangeNavbar({
|
||||
id: "Event",
|
||||
childId: "Event_3",
|
||||
});
|
||||
}
|
||||
|
||||
if (checkEvent.statusName == "reject") {
|
||||
onChangeNavbar({
|
||||
id: "Event",
|
||||
childId: "Event_4",
|
||||
});
|
||||
}
|
||||
|
||||
setIsAdminEvent_TriggerReview(false);
|
||||
router.push(path);
|
||||
setVisible(false);
|
||||
setDataId("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// // FORUM
|
||||
// e?.kategoriApp === "FORUM" &&
|
||||
// adminNotifikasi_findRouterForum({
|
||||
// data: e,
|
||||
// router: router,
|
||||
// onChangeNavbar(val) {
|
||||
// onChangeNavbar(val);
|
||||
// },
|
||||
// onToggleNavbar(val) {
|
||||
// onToggleNavbar(val);
|
||||
// },
|
||||
// });
|
||||
|
||||
// // VOTE
|
||||
// e?.kategoriApp === "VOTING" &&
|
||||
// adminNotifikasi_findRouterVoting({
|
||||
// data: e,
|
||||
// router: router,
|
||||
// onChangeNavbar(val) {
|
||||
// onChangeNavbar(val);
|
||||
// },
|
||||
// onToggleNavbar(val) {
|
||||
// onToggleNavbar(val);
|
||||
// },
|
||||
// });
|
||||
|
||||
// // EVENT
|
||||
// e?.kategoriApp === "EVENT" &&
|
||||
//
|
||||
|
||||
// // DONASI
|
||||
// e.kategoriApp === "DONASI" &&
|
||||
// adminNotifikasi_findRouterDonasi({
|
||||
// data: e,
|
||||
// router: router,
|
||||
// onChangeNavbar(val) {
|
||||
// onChangeNavbar(val);
|
||||
// },
|
||||
// onToggleNavbar(val) {
|
||||
// onToggleNavbar(val);
|
||||
// },
|
||||
// });
|
||||
|
||||
// // INVESTASI
|
||||
// e.kategoriApp === "INVESTASI" &&
|
||||
// adminNotifikasi_findRouterInvestasi({
|
||||
// data: e,
|
||||
// router: router,
|
||||
// onChangeNavbar(val) {
|
||||
// onChangeNavbar(val);
|
||||
// },
|
||||
// onToggleNavbar(val) {
|
||||
// onToggleNavbar(val);
|
||||
// },
|
||||
// });
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
style={{
|
||||
transition: "0.5s",
|
||||
}}
|
||||
mb={"md"}
|
||||
c={"white"}
|
||||
key={data.id}
|
||||
bg={data.isRead ? "gray" : AccentColor.darkblue}
|
||||
sx={{
|
||||
borderColor: AccentColor.blue,
|
||||
borderStyle: "solid",
|
||||
borderWidth: "2px",
|
||||
":hover": {
|
||||
backgroundColor: AccentColor.blue,
|
||||
borderColor: AccentColor.softblue,
|
||||
borderStyle: "solid",
|
||||
borderWidth: "2px",
|
||||
},
|
||||
}}
|
||||
onClick={async () => {
|
||||
onRead({ data: data });
|
||||
// callBackIsNotifikasi(false);
|
||||
}}
|
||||
>
|
||||
<Card.Section p={"sm"}>
|
||||
<Stack spacing={"xs"}>
|
||||
<Group position="apart">
|
||||
<Text fw={"bold"} fz={10}>
|
||||
# {data.kategoriApp}
|
||||
</Text>
|
||||
{data.status ? (
|
||||
<Badge fz={10} size="sm">
|
||||
{data.status}
|
||||
</Badge>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Group>
|
||||
<Divider color="gray.3" />
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
<Card.Section px={"sm"} pb={"sm"}>
|
||||
<Stack spacing={0}>
|
||||
<Text lineClamp={2} fw={"bold"} fz={"xs"}>
|
||||
{data.title}
|
||||
</Text>
|
||||
<Text lineClamp={2} fz={"xs"}>
|
||||
{data.pesan}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
<Card.Section p={"sm"}>
|
||||
<Group position="apart">
|
||||
<Text fz={10}>
|
||||
{new Intl.DateTimeFormat("id-ID", {
|
||||
dateStyle: "long",
|
||||
}).format(data.createdAt)}
|
||||
|
||||
<Text span inherit fz={10}>
|
||||
{", "}
|
||||
{new Intl.DateTimeFormat("id-ID", {
|
||||
timeStyle: "short",
|
||||
}).format(data.createdAt)}
|
||||
</Text>
|
||||
</Text>
|
||||
{data.isRead ? (
|
||||
<Group spacing={5}>
|
||||
<IconChecks size={10} />
|
||||
<Text fz={10}>Sudah dilihat</Text>
|
||||
</Group>
|
||||
) : (
|
||||
<Group spacing={5}>
|
||||
<IconCheck size={10} />
|
||||
<Text fz={10}>Belum dilihat</Text>
|
||||
</Group>
|
||||
)}
|
||||
</Group>
|
||||
{visible && dataId === data.id && (
|
||||
<ComponentGlobal_CardLoadingOverlay />
|
||||
)}
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user