# Voting prototype

- feat
- Tampilan beranda
- Tampilan status
- Tampilan kontribusi
- Tampilan riwayat
## No Issue
This commit is contained in:
2024-02-07 15:18:25 +08:00
parent d64ed7bf55
commit e6c120bf75
85 changed files with 2538 additions and 231 deletions

View File

@@ -3,15 +3,16 @@
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
import { Stack, Grid, Avatar, Divider, Text } from "@mantine/core";
import { useRouter } from "next/navigation";
import { ComponentGlobal_NotifikasiPeringatan } from "./notif_global/notifikasi_peringatan";
export default function ComponentGlobal_AuthorNameOnHeader({
profileId,
imagesId,
authorName,
}: {
profileId: string;
imagesId: string;
authorName: string;
profileId?: string;
imagesId?: string;
authorName?: string;
}) {
const router = useRouter();
return (
@@ -21,7 +22,11 @@ export default function ComponentGlobal_AuthorNameOnHeader({
<Grid.Col
span={"content"}
onClick={() => {
router.push(RouterProfile.katalog + profileId);
if (profileId) {
router.push(RouterProfile.katalog + profileId);
} else {
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
}
}}
>
<Avatar
@@ -29,13 +34,17 @@ export default function ComponentGlobal_AuthorNameOnHeader({
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
radius={"xl"}
bg={"gray.1"}
src={RouterProfile.api_foto_profile + imagesId}
src={
imagesId
? RouterProfile.api_foto_profile + imagesId
: "/aset/global/avatar.png"
}
/>
</Grid.Col>
<Grid.Col span={"auto"}>
<Stack justify="center" h={"100%"}>
<Text truncate fz={"sm"} fw={"bold"}>
{authorName}
{authorName ? authorName : "Nama author"}
</Text>
</Stack>
</Grid.Col>