Admin Collaboration Done
# feat - Detail Project - Report Project ## No Issuue
This commit is contained in:
@@ -45,7 +45,7 @@ export default function Colab_GrupDiskus({
|
||||
p={"md"}
|
||||
onClick={() => {
|
||||
router.push(
|
||||
RouterColab.detail_grup + e?.ProjectCollaboration_RoomChat.id
|
||||
RouterColab.group_chat + e?.ProjectCollaboration_RoomChat.id
|
||||
);
|
||||
setIdRoom(e?.ProjectCollaboration_RoomChat.id);
|
||||
setLoading(true);
|
||||
@@ -55,12 +55,12 @@ export default function Colab_GrupDiskus({
|
||||
<Grid.Col span={"auto"}>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"} lineClamp={1}>
|
||||
{e.ProjectCollaboration_RoomChat.name}
|
||||
{e?.ProjectCollaboration_RoomChat?.name}
|
||||
</Text>
|
||||
<Text fz={"xs"} c={"gray"}>
|
||||
{
|
||||
e.ProjectCollaboration_RoomChat
|
||||
.ProjectCollaboration_AnggotaRoomChat.length
|
||||
e?.ProjectCollaboration_RoomChat
|
||||
?.ProjectCollaboration_AnggotaRoomChat.length
|
||||
}{" "}
|
||||
Anggota
|
||||
</Text>
|
||||
@@ -68,7 +68,7 @@ export default function Colab_GrupDiskus({
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"content"}>
|
||||
<Center>
|
||||
{e?.ProjectCollaboration_RoomChat.id === idRoom ? (
|
||||
{e?.ProjectCollaboration_RoomChat?.id === idRoom ? (
|
||||
<Loader color="gray" size={20} />
|
||||
) : (
|
||||
<IconChevronRight color="gray" />
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
Center,
|
||||
Footer,
|
||||
Grid,
|
||||
Indicator,
|
||||
Loader,
|
||||
Stack,
|
||||
Text,
|
||||
@@ -32,8 +33,10 @@ import { useTimeout } from "@mantine/hooks";
|
||||
|
||||
export default function LayoutColab_Main({
|
||||
children,
|
||||
cekNotif,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
cekNotif: boolean;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_colab_hot_menu);
|
||||
@@ -70,7 +73,13 @@ export default function LayoutColab_Main({
|
||||
id: 5,
|
||||
name: "Notifikasi",
|
||||
path: RouterColab.notifikasi,
|
||||
icon: <IconBell />,
|
||||
icon: cekNotif ? (
|
||||
<Indicator processing color="orange">
|
||||
<IconBell />
|
||||
</Indicator>
|
||||
) : (
|
||||
<IconBell />
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -1,14 +1,73 @@
|
||||
"use client";
|
||||
|
||||
import { Center, Text, Title } from "@mantine/core";
|
||||
import {
|
||||
ActionIcon,
|
||||
Center,
|
||||
Group,
|
||||
Paper,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import ComponentColab_IsEmptyData from "../../component/is_empty_data";
|
||||
import _ from "lodash";
|
||||
import { MODEL_COLLABORATION_NOTIFIKSI } from "../../model/interface";
|
||||
import { IconChevronRight } from "@tabler/icons-react";
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import colab_funUpdateIsReadByNotifId from "../../fun/edit/fun_is_read_by_id";
|
||||
|
||||
export default function Colab_NotifikasiView() {
|
||||
export default function Colab_NotifikasiView({
|
||||
listNotifikasi,
|
||||
}: {
|
||||
listNotifikasi?: MODEL_COLLABORATION_NOTIFIKSI[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [notifId, setNotifId] = useState("");
|
||||
|
||||
if (_.isEmpty(listNotifikasi))
|
||||
return <ComponentColab_IsEmptyData text="Tidak ada data" />;
|
||||
|
||||
async function onRead(notifId: string) {
|
||||
await colab_funUpdateIsReadByNotifId(notifId).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setNotifId(notifId);
|
||||
router.push(RouterColab.detail_notifikasi + notifId);
|
||||
} else {
|
||||
console.log(``);
|
||||
}
|
||||
});
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Center>
|
||||
<ComponentColab_IsEmptyData text="Cooming Soon" />
|
||||
</Center>
|
||||
<Stack>
|
||||
{listNotifikasi?.map((e, i) => (
|
||||
<Paper
|
||||
key={i}
|
||||
bg={e?.isRead ? "gray.1" : "gray.4"}
|
||||
p={"md"}
|
||||
onClick={() => {
|
||||
onRead(e?.id);
|
||||
}}
|
||||
>
|
||||
<Group position="apart">
|
||||
<Stack spacing={0} w={"80%"}>
|
||||
<Text fw={"bold"} fz={"xs"} lineClamp={1}>
|
||||
{e.note}
|
||||
</Text>
|
||||
<Text lineClamp={1}>{e.ProjectCollaboration.report}</Text>
|
||||
</Stack>
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
loading={e?.id === notifId ? true : false}
|
||||
>
|
||||
<IconChevronRight />
|
||||
</ActionIcon>
|
||||
</Group>
|
||||
</Paper>
|
||||
))}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user