# Voting prototype
- feat - Tampilan beranda - Tampilan status - Tampilan kontribusi - Tampilan riwayat ## No Issue
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user