Hold persiapan persentase pak fahmi

- Sudah bisa create
- Sudah bisa join proyek
- Tambahan untuk mengisi form jika ingin join
### No issue
This commit is contained in:
2024-04-18 14:14:08 +08:00
parent ed77b569a6
commit 4b78a45479
45 changed files with 809 additions and 143 deletions

View File

@@ -1,26 +1,39 @@
"use client";
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
import { Avatar, Card, Divider, Grid, Stack, Text } from "@mantine/core";
import {
ActionIcon,
Avatar,
Card,
Divider,
Grid,
Menu,
Stack,
Text,
} from "@mantine/core";
import ComponentColab_AuthorNameOnHeader from "../header_author_name";
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
import { useRouter } from "next/navigation";
import { IconDots, IconEdit } from "@tabler/icons-react";
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
import { useDisclosure } from "@mantine/hooks";
import { useState } from "react";
export default function ComponentColab_CardSectionHeaderAuthorName({
profileId,
imagesId,
authorName,
tglPublish,
isPembatas,
jumlah_partisipan,
isAuthor,
colabId,
}: {
profileId?: string;
imagesId?: string;
authorName?: string;
tglPublish?: Date;
isPembatas?: boolean;
jumlah_partisipan?: any[]
isAuthor?: boolean;
colabId?: string;
}) {
const router = useRouter();
@@ -59,15 +72,10 @@ export default function ComponentColab_CardSectionHeaderAuthorName({
</Stack>
</Grid.Col>
<Grid.Col span={"content"}>
<Stack justify="center" h={"100%"}>
{tglPublish ? (
<Text c={"gray"} fz={"xs"}>
{new Intl.DateTimeFormat("id-ID").format(tglPublish)}
</Text>
) : (
""
)}
</Stack>
<ButtonAction
isAuthor={isAuthor as any}
colabId={colabId as any}
/>
</Grid.Col>
</Grid>
{isPembatas ? <Divider /> : ""}
@@ -76,3 +84,45 @@ export default function ComponentColab_CardSectionHeaderAuthorName({
</>
);
}
function ButtonAction({
isAuthor,
colabId,
}: {
isAuthor: boolean;
colabId: string;
}) {
const router = useRouter();
const [opened, setOpened] = useState(false);
return (
<>
<Menu
opened={opened}
onChange={setOpened}
position="left-start"
offset={0}
shadow="lg"
withArrow
arrowPosition="center"
>
<Menu.Target >
<Stack justify="center" h={"100%"} >
<ActionIcon variant="transparent">
{isAuthor ? <IconDots size={20} /> : ""}
</ActionIcon>
</Stack>
</Menu.Target>
<Menu.Dropdown bg={"gray.1"} >
<Menu.Item
icon={<IconEdit size={15} />}
onClick={() => {
router.push(RouterColab.edit + colabId);
}}
>
Edit
</Menu.Item>
</Menu.Dropdown>
</Menu>
</>
);
}

View File

@@ -0,0 +1,13 @@
"use client";
import { Center } from "@mantine/core";
export default function ComponentColab_IsEmptyData({ text }: { text: string }) {
return (
<>
<Center h={"50vh"} fz={"sm"} c="gray" fw={"bold"}>
{text}
</Center>
</>
);
}