# Event Join

## feat
- Join event
- History semua event dan event saya
### No Issuue
This commit is contained in:
2024-01-31 10:48:20 +08:00
parent ca9214d9e0
commit c01906c063
40 changed files with 682 additions and 98 deletions

View File

@@ -2,6 +2,7 @@
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
import {
Affix,
Avatar,
Badge,
Box,
@@ -17,6 +18,7 @@ import {
Stack,
Text,
Title,
rem,
} from "@mantine/core";
import moment from "moment";
import { useRouter } from "next/navigation";
@@ -25,6 +27,8 @@ import { MODEL_EVENT } from "../model/interface";
import ComponentEvent_BoxListStatus from "../component/box_list_status";
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
import _ from "lodash";
import { IconCirclePlus } from "@tabler/icons-react";
export default function Event_Beranda({
dataEvent,
@@ -32,42 +36,72 @@ export default function Event_Beranda({
dataEvent: MODEL_EVENT[];
}) {
const router = useRouter();
// if (_.isEmpty(dataEvent))
// return (
// <Center h={"80vh"}>
// <Text fw={"bold"} fz={"sm"}>
// Tidak Ada Event
// </Text>
// </Center>
// );
return (
<>
{dataEvent.map((e, i) => (
<Card key={e.id} shadow="lg" radius={"md"} withBorder mb={"sm"}>
<Card.Section px={"sm"} pt={"sm"}>
<ComponentGlobal_AuthorNameOnHeader
profileId={e.Author.Profile.id}
imagesId={e.Author.Profile.imagesId}
authorName={e.Author.Profile.name}
/>
</Card.Section>
<Card.Section
p={"sm"}
onClick={() => router.push(RouterEvent.detail_main + e.id)}
>
<Stack>
<Grid>
<Grid.Col span={8}>
<Title order={6} truncate>
{e.title}
</Title>
</Grid.Col>
<Grid.Col span={4}>
<Text fz={"sm"} truncate>
{moment(e.tanggal).format("ll")}
</Text>
</Grid.Col>
</Grid>
{/* <Affix position={{ bottom: rem(100), right: rem(20) }}>
<Button
radius={"xl"}
color="blue"
leftIcon={<IconCirclePlus />}
onClick={() => router.push(RouterEvent.create)}
>
<Text fz={"sm"}> Tambah Event</Text>
</Button>
</Affix> */}
<Text fz={"sm"} lineClamp={2}>
{e.deskripsi}
</Text>
</Stack>
</Card.Section>
</Card>
))}
{_.isEmpty(dataEvent) ? (
<Center h={"80vh"}>
<Text fw={"bold"} fz={"sm"}>
Tidak Ada Event
</Text>
</Center>
) : (
<Box>
{dataEvent.map((e, i) => (
<Card key={e.id} shadow="lg" radius={"md"} withBorder mb={"sm"}>
<Card.Section px={"sm"} pt={"sm"}>
<ComponentGlobal_AuthorNameOnHeader
profileId={e.Author.Profile.id}
imagesId={e.Author.Profile.imagesId}
authorName={e.Author.Profile.name}
/>
</Card.Section>
<Card.Section
p={"sm"}
onClick={() => router.push(RouterEvent.detail_main + e.id)}
>
<Stack>
<Grid>
<Grid.Col span={8}>
<Title order={6} truncate>
{e.title}
</Title>
</Grid.Col>
<Grid.Col span={4}>
<Text fz={"sm"} truncate>
{moment(e.tanggal).format("ll")}
</Text>
</Grid.Col>
</Grid>
<Text fz={"sm"} lineClamp={2}>
{e.deskripsi}
</Text>
</Stack>
</Card.Section>
</Card>
))}
</Box>
)}
</>
);
}