Fix : Avatar
Deskripsi: - Ubah avatar yang image nya di ambil dari storage wibu server - Avatar forum - Avatra job - Avatar Investasi - Avatar donasi ## No Issuee
This commit is contained in:
@@ -93,6 +93,11 @@ export default function ComponentForum_DetailCreateKomentar({
|
||||
onChange={(val) => {
|
||||
setValue(val);
|
||||
}}
|
||||
style={{
|
||||
overflowY: "auto",
|
||||
maxHeight: 100,
|
||||
minHeight: 50,
|
||||
}}
|
||||
/>
|
||||
</Paper>
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@ import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
|
||||
export default function ComponentForum_DetailHeader({
|
||||
data,
|
||||
@@ -59,6 +61,7 @@ export default function ComponentForum_DetailHeader({
|
||||
onLoadData: (val: any) => void;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -68,30 +71,38 @@ export default function ComponentForum_DetailHeader({
|
||||
span={"content"}
|
||||
onClick={() => {
|
||||
if (data?.Author?.id) {
|
||||
setIsLoading(true);
|
||||
router.push(RouterForum.forumku + data?.Author?.id);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Avatar
|
||||
size={40}
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
data?.Author.Profile.imagesId
|
||||
? RouterProfile.api_foto_profile +
|
||||
data?.Author.Profile.imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
/>
|
||||
{isLoading ? (
|
||||
<Avatar
|
||||
size={40}
|
||||
radius={"100%"}
|
||||
style={{
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: "1px",
|
||||
}}
|
||||
>
|
||||
<ComponentGlobal_Loader variant="dots" />
|
||||
</Avatar>
|
||||
) : (
|
||||
<ComponentGlobal_LoaderAvatar
|
||||
fileId={data?.Author.Profile?.imageId as any}
|
||||
/>
|
||||
)}
|
||||
</Grid.Col>
|
||||
|
||||
<Grid.Col span={"auto"}>
|
||||
<Stack spacing={3}>
|
||||
<Text lineClamp={1} fz={"sm"} fw={"bold"} color="white">
|
||||
{data?.Author.username ? data?.Author.username : "Nama author "}
|
||||
{data?.Author.Profile.name
|
||||
? data?.Author.Profile.name
|
||||
: "Nama author "}
|
||||
</Text>
|
||||
<Badge
|
||||
w={70}
|
||||
@@ -102,11 +113,7 @@ export default function ComponentForum_DetailHeader({
|
||||
: "red"
|
||||
}
|
||||
>
|
||||
<Text fz={10}>
|
||||
{(data?.ForumMaster_StatusPosting.id as any) === 1
|
||||
? "Open"
|
||||
: "Close"}
|
||||
</Text>
|
||||
<Text fz={10}>{data?.ForumMaster_StatusPosting.status}</Text>
|
||||
</Badge>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Stack,
|
||||
Center,
|
||||
Box,
|
||||
Card,
|
||||
Spoiler,
|
||||
Divider,
|
||||
Text,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Text
|
||||
} from "@mantine/core";
|
||||
import _ from "lodash";
|
||||
import { MODEL_FORUM_KOMENTAR } from "../../model/interface";
|
||||
import ComponentForum_KomentarAuthorNameOnHeader from "../komentar_component/komentar_author_header_name";
|
||||
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export default function ComponentForum_KomentarView({
|
||||
data,
|
||||
@@ -30,8 +26,6 @@ export default function ComponentForum_KomentarView({
|
||||
<Card mb={"xs"} bg={"transparent"}>
|
||||
<Card.Section>
|
||||
<ComponentForum_KomentarAuthorNameOnHeader
|
||||
authorName={data?.Author?.username}
|
||||
imagesId={data?.Author?.Profile?.imagesId}
|
||||
tglPublish={data?.createdAt}
|
||||
userId={data?.Author?.id}
|
||||
komentarId={data?.id}
|
||||
@@ -39,6 +33,7 @@ export default function ComponentForum_KomentarView({
|
||||
setKomentar={setKomentar}
|
||||
postingId={postingId}
|
||||
userLoginId={userLoginId}
|
||||
profile={data.Author.Profile}
|
||||
/>
|
||||
</Card.Section>
|
||||
<Card.Section sx={{ zIndex: 0 }} p={"sm"}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { Card, Stack, Group, Text } from "@mantine/core";
|
||||
import { Card, Stack, Group, Text, Box } from "@mantine/core";
|
||||
import { IconMessageCircle, IconMessageCircleX } from "@tabler/icons-react";
|
||||
import { MODEL_FORUM_POSTING } from "../../model/interface";
|
||||
import ComponentForum_DetailHeader from "./detail_header";
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||
|
||||
export default function ComponentForum_DetailForumView({
|
||||
data,
|
||||
@@ -22,19 +23,9 @@ export default function ComponentForum_DetailForumView({
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
mb={"md"}
|
||||
p={"xl"}
|
||||
bg={MainColor.darkblue}
|
||||
style={{
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
}}
|
||||
radius={"md"}
|
||||
>
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
|
||||
{/* HEADER */}
|
||||
<Card.Section>
|
||||
<ComponentGlobal_CardStyles>
|
||||
<Stack>
|
||||
{/* HEADER */}
|
||||
<ComponentForum_DetailHeader
|
||||
data={data}
|
||||
userLoginId={userLoginId}
|
||||
@@ -42,11 +33,9 @@ export default function ComponentForum_DetailForumView({
|
||||
onLoadData(val);
|
||||
}}
|
||||
/>
|
||||
</Card.Section>
|
||||
|
||||
{/* CONTENT */}
|
||||
<Card.Section sx={{ zIndex: 0 }} p={"lg"}>
|
||||
<Stack spacing={"xs"}>
|
||||
{/* CONTENT */}
|
||||
<Box p={"lg"} >
|
||||
<Text fz={"sm"} color="white">
|
||||
{data?.diskusi ? (
|
||||
<div dangerouslySetInnerHTML={{ __html: data?.diskusi }} />
|
||||
@@ -54,11 +43,9 @@ export default function ComponentForum_DetailForumView({
|
||||
""
|
||||
)}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Box>
|
||||
|
||||
{/* FOOTER */}
|
||||
<Card.Section>
|
||||
{/* FOOTER */}
|
||||
<Stack>
|
||||
<Group position="apart">
|
||||
<Group spacing={"xs"} px={"sm"}>
|
||||
@@ -94,8 +81,8 @@ export default function ComponentForum_DetailForumView({
|
||||
</Group>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</Stack>
|
||||
</ComponentGlobal_CardStyles>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,8 @@ import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_FORUM_POSTING } from "../../model/interface";
|
||||
import ComponentForum_ForumkuMoreButton from "./forumku_more_button";
|
||||
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
|
||||
|
||||
export default function ComponentForum_ForumkuHeaderCard({
|
||||
data,
|
||||
@@ -25,7 +26,6 @@ export default function ComponentForum_ForumkuHeaderCard({
|
||||
allData: any[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -35,29 +35,15 @@ export default function ComponentForum_ForumkuHeaderCard({
|
||||
span={"content"}
|
||||
onClick={() => {
|
||||
if (data.Author.id) {
|
||||
setIsLoading(true);
|
||||
router.push(RouterForum.forumku + data.Author.id);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
|
||||
}
|
||||
}}
|
||||
>
|
||||
{isLoading ? (
|
||||
<Loader color="gray" variant="dots" />
|
||||
) : (
|
||||
<Avatar
|
||||
size={40}
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
data.Author.Profile.imagesId
|
||||
? RouterProfile.api_foto_profile +
|
||||
data.Author.Profile.imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
/>
|
||||
)}
|
||||
<ComponentGlobal_LoaderAvatar
|
||||
fileId={data.Author.Profile.imageId as any}
|
||||
/>
|
||||
</Grid.Col>
|
||||
|
||||
<Grid.Col span={"auto"}>
|
||||
@@ -82,7 +68,9 @@ export default function ComponentForum_ForumkuHeaderCard({
|
||||
: "red"
|
||||
}
|
||||
>
|
||||
<Text c={"white"} fz={10}>{data?.ForumMaster_StatusPosting.status}</Text>
|
||||
<Text c={"white"} fz={10}>
|
||||
{data?.ForumMaster_StatusPosting.status}
|
||||
</Text>
|
||||
</Badge>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
@@ -90,7 +78,7 @@ export default function ComponentForum_ForumkuHeaderCard({
|
||||
<Grid.Col span={"content"}>
|
||||
<Group position="center" spacing={"xs"}>
|
||||
<Group spacing={3}>
|
||||
<Text c={"white"} fz={"sm"} >
|
||||
<Text c={"white"} fz={"sm"}>
|
||||
{data.createdAt !== undefined && data?.createdAt
|
||||
? new Date(data?.createdAt).toLocaleDateString(["id-ID"], {
|
||||
day: "numeric",
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||
import { ActionIcon, Card, Divider, Group, Stack, Text } from "@mantine/core";
|
||||
import {
|
||||
ComponentGlobal_CardLoadingOverlay,
|
||||
ComponentGlobal_CardStyles,
|
||||
} from "@/app_modules/_global/component";
|
||||
import { Box, Group, Stack, Text } from "@mantine/core";
|
||||
import { IconMessageCircle, IconMessageCircleX } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_FORUM_POSTING } from "../../model/interface";
|
||||
import ComponentForum_ForumkuHeaderCard from "./forumku_header";
|
||||
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
|
||||
export default function ComponentForum_ForumkuMainCardView({
|
||||
data,
|
||||
@@ -22,23 +24,12 @@ export default function ComponentForum_ForumkuMainCardView({
|
||||
allData: any[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [loadingKomen, setLoadingKomen] = useState(false);
|
||||
const [loadingDetail, setLoadingDetail] = useState(false);
|
||||
|
||||
const [postingId, setPostingId] = useState("");
|
||||
const [visable, setVisible] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
mb={"md"}
|
||||
p={"xl"}
|
||||
bg={MainColor.darkblue}
|
||||
style={{
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
}}
|
||||
radius={"md"}
|
||||
>
|
||||
<Card.Section>
|
||||
<ComponentGlobal_CardStyles>
|
||||
<Stack>
|
||||
<ComponentForum_ForumkuHeaderCard
|
||||
data={data}
|
||||
isMoreButton={true}
|
||||
@@ -46,42 +37,40 @@ export default function ComponentForum_ForumkuMainCardView({
|
||||
onLoadData={onLoadData}
|
||||
allData={allData}
|
||||
/>
|
||||
</Card.Section>
|
||||
|
||||
<Card.Section
|
||||
sx={{ zIndex: 0 }}
|
||||
p={"lg"}
|
||||
onClick={() => {
|
||||
router.push(RouterForum.main_detail + data?.id);
|
||||
}}
|
||||
>
|
||||
<Text c={"white"} fz={"sm"} lineClamp={4}>
|
||||
<div dangerouslySetInnerHTML={{ __html: data?.diskusi }} />
|
||||
</Text>
|
||||
</Card.Section>
|
||||
<Box
|
||||
sx={{ zIndex: 0 }}
|
||||
p={"lg"}
|
||||
onClick={() => {
|
||||
setVisible(true);
|
||||
router.push(RouterForum.main_detail + data?.id);
|
||||
}}
|
||||
>
|
||||
<Text c={"white"} fz={"sm"} lineClamp={4}>
|
||||
<div dangerouslySetInnerHTML={{ __html: data?.diskusi }} />
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
<Group spacing={"xs"} px={"sm"}>
|
||||
<ActionIcon
|
||||
loading={loadingKomen && data?.id === postingId ? true : false}
|
||||
variant="transparent"
|
||||
sx={{ zIndex: 1 }}
|
||||
>
|
||||
{(data?.ForumMaster_StatusPosting?.id as any) === 1 ? (
|
||||
<IconMessageCircle color="white" size={25} />
|
||||
) : (
|
||||
<IconMessageCircleX color="gray" size={25} />
|
||||
)}
|
||||
</ActionIcon>
|
||||
<Group spacing={"xs"} px={"sm"}>
|
||||
{(data?.ForumMaster_StatusPosting?.id as any) === 1 ? (
|
||||
<IconMessageCircle color="white" size={25} />
|
||||
) : (
|
||||
<IconMessageCircleX color="gray" size={25} />
|
||||
)}
|
||||
|
||||
{/* <TotalKomentar postingId={e?.id} /> */}
|
||||
|
||||
<Text c={(data?.ForumMaster_StatusPosting?.id as any) === 1 ? "white" : "gray"}>{data?.Forum_Komentar.length}</Text>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
<Text
|
||||
c={
|
||||
(data?.ForumMaster_StatusPosting?.id as any) === 1
|
||||
? "white"
|
||||
: "gray"
|
||||
}
|
||||
>
|
||||
{data?.Forum_Komentar.length}
|
||||
</Text>
|
||||
</Group>
|
||||
{visable && <ComponentGlobal_CardLoadingOverlay />}
|
||||
</Stack>
|
||||
</ComponentGlobal_CardStyles>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,50 +1,41 @@
|
||||
"use client";
|
||||
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { Stack, Grid, Avatar, Divider, Text, Group } from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import moment from "moment";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||
import {
|
||||
IconCircleFilled,
|
||||
IconDots,
|
||||
IconEdit,
|
||||
IconFlag3,
|
||||
IconMessageCircle,
|
||||
IconTrash,
|
||||
} from "@tabler/icons-react";
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import { Avatar, Divider, Grid, Group, Stack, Text } from "@mantine/core";
|
||||
import { IconCircle } from "@tabler/icons-react";
|
||||
import { IoIosMore } from "react-icons/io";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { useState } from "react";
|
||||
import ComponentForum_PostingButtonMore from "../more_button/posting_button_more";
|
||||
import { useRouter } from "next/navigation";
|
||||
import ComponentForum_KomentarButtonMore from "./komentar_button_more";
|
||||
import { useState } from "react";
|
||||
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
import { data } from "autoprefixer";
|
||||
import { MODEL_PROFILE } from "@/app_modules/katalog/profile/model/interface";
|
||||
|
||||
export default function ComponentForum_KomentarAuthorNameOnHeader({
|
||||
userId,
|
||||
komentarId,
|
||||
imagesId,
|
||||
authorName,
|
||||
tglPublish,
|
||||
isPembatas,
|
||||
isMoreButton,
|
||||
setKomentar,
|
||||
postingId,
|
||||
userLoginId,
|
||||
profile,
|
||||
}: {
|
||||
userId?: string;
|
||||
komentarId?: string;
|
||||
imagesId?: string;
|
||||
authorName?: string;
|
||||
tglPublish?: Date;
|
||||
isPembatas?: boolean;
|
||||
isMoreButton?: boolean;
|
||||
setKomentar?: any;
|
||||
postingId?: string;
|
||||
userLoginId: string;
|
||||
profile: MODEL_PROFILE;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -54,30 +45,35 @@ export default function ComponentForum_KomentarAuthorNameOnHeader({
|
||||
span={"content"}
|
||||
onClick={() => {
|
||||
if (userId) {
|
||||
setIsLoading(true);
|
||||
router.push(RouterForum.forumku + userId);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Avatar
|
||||
size={30}
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
imagesId
|
||||
? RouterProfile.api_foto_profile + imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
/>
|
||||
{isLoading ? (
|
||||
<Avatar
|
||||
size={40}
|
||||
radius={"100%"}
|
||||
style={{
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: "1px",
|
||||
}}
|
||||
>
|
||||
<ComponentGlobal_Loader variant="dots" />
|
||||
</Avatar>
|
||||
) : (
|
||||
<ComponentGlobal_LoaderAvatar fileId={profile.imageId as any} />
|
||||
)}
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Stack justify="center" h={"100%"}>
|
||||
<Grid>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text color="white" lineClamp={1} fz={"sm"} fw={"bold"}>
|
||||
{authorName ? authorName : "Nama author "}
|
||||
{profile.name ? profile.name : "Nama author "}
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
|
||||
@@ -3,20 +3,14 @@
|
||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Grid,
|
||||
Group,
|
||||
Loader,
|
||||
Stack,
|
||||
Text
|
||||
} from "@mantine/core";
|
||||
import { Avatar, Badge, Grid, Group, Loader, Stack, Text } from "@mantine/core";
|
||||
import { IconCircle } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_FORUM_POSTING } from "../../model/interface";
|
||||
import ComponentForum_BerandaMoreButton from "./card_more_button";
|
||||
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
|
||||
export default function ComponentForum_BerandaHeaderCard({
|
||||
data,
|
||||
@@ -50,23 +44,20 @@ export default function ComponentForum_BerandaHeaderCard({
|
||||
}}
|
||||
>
|
||||
{isLoading ? (
|
||||
<Loader color="gray" variant="dots" />
|
||||
) : (
|
||||
<Avatar
|
||||
size={40}
|
||||
sx={{
|
||||
radius={"100%"}
|
||||
style={{
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: "1px",
|
||||
borderColor: "white",
|
||||
}}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
data.Author.Profile.imagesId
|
||||
? RouterProfile.api_foto_profile +
|
||||
data.Author.Profile.imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
>
|
||||
<ComponentGlobal_Loader variant="dots" />
|
||||
</Avatar>
|
||||
) : (
|
||||
<ComponentGlobal_LoaderAvatar
|
||||
fileId={data.Author.Profile.imageId as any}
|
||||
/>
|
||||
)}
|
||||
</Grid.Col>
|
||||
@@ -76,8 +67,8 @@ export default function ComponentForum_BerandaHeaderCard({
|
||||
<Grid>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text lineClamp={1} fz={"sm"} fw={"bold"} color={"white"}>
|
||||
{data.Author.username
|
||||
? data.Author.username
|
||||
{data.Author.Profile.name
|
||||
? data.Author.Profile.name
|
||||
: "Nama author "}
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { ActionIcon, Card, Group, Stack, Text } from "@mantine/core";
|
||||
ComponentGlobal_CardLoadingOverlay,
|
||||
ComponentGlobal_CardStyles,
|
||||
} from "@/app_modules/_global/component";
|
||||
import { Box, Group, Stack, Text } from "@mantine/core";
|
||||
import { IconMessageCircle, IconMessageCircleX } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
@@ -24,23 +24,12 @@ export default function ComponentForum_BerandaCardView({
|
||||
allData: any[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [loadingKomen, setLoadingKomen] = useState(false);
|
||||
const [loadingDetail, setLoadingDetail] = useState(false);
|
||||
|
||||
const [postingId, setPostingId] = useState("");
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
mb={"md"}
|
||||
p={"xl"}
|
||||
bg={MainColor.darkblue}
|
||||
style={{
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
}}
|
||||
radius={"md"}
|
||||
>
|
||||
<Card.Section>
|
||||
<ComponentGlobal_CardStyles>
|
||||
<Stack>
|
||||
<ComponentForum_BerandaHeaderCard
|
||||
data={data}
|
||||
isMoreButton={true}
|
||||
@@ -48,42 +37,39 @@ export default function ComponentForum_BerandaCardView({
|
||||
onLoadData={onLoadData}
|
||||
allData={allData}
|
||||
/>
|
||||
</Card.Section>
|
||||
|
||||
<Card.Section
|
||||
sx={{ zIndex: 0 }}
|
||||
p={"lg"}
|
||||
onClick={() => {
|
||||
router.push(RouterForum.main_detail + data?.id);
|
||||
}}
|
||||
>
|
||||
<Text c="white" fz={"sm"} lineClamp={4}>
|
||||
<div dangerouslySetInnerHTML={{ __html: data?.diskusi }} />
|
||||
</Text>
|
||||
</Card.Section>
|
||||
<Box
|
||||
sx={{ zIndex: 0 }}
|
||||
p={"lg"}
|
||||
onClick={() => {
|
||||
setVisible(true), router.push(RouterForum.main_detail + data?.id);
|
||||
}}
|
||||
>
|
||||
<Text c="white" fz={"sm"} lineClamp={4}>
|
||||
<div dangerouslySetInnerHTML={{ __html: data?.diskusi }} />
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
<Group spacing={"xs"} px={"sm"}>
|
||||
<ActionIcon
|
||||
loading={loadingKomen && data?.id === postingId ? true : false}
|
||||
variant="transparent"
|
||||
sx={{ zIndex: 1 }}
|
||||
>
|
||||
{(data?.ForumMaster_StatusPosting?.id as any) === 1 ? (
|
||||
<IconMessageCircle color="white" size={25} />
|
||||
) : (
|
||||
<IconMessageCircleX color="gray" size={25} />
|
||||
)}
|
||||
</ActionIcon>
|
||||
<Group spacing={"xs"}>
|
||||
{(data?.ForumMaster_StatusPosting?.id as any) === 1 ? (
|
||||
<IconMessageCircle color="white" size={25} />
|
||||
) : (
|
||||
<IconMessageCircleX color="gray" size={25} />
|
||||
)}
|
||||
|
||||
{/* <TotalKomentar postingId={e?.id} /> */}
|
||||
|
||||
<Text color={(data?.ForumMaster_StatusPosting?.id as any) === 1 ? "white" :"gray"}>{data?.Forum_Komentar.length}</Text>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
<Text
|
||||
color={
|
||||
(data?.ForumMaster_StatusPosting?.id as any) === 1
|
||||
? "white"
|
||||
: "gray"
|
||||
}
|
||||
>
|
||||
{data?.Forum_Komentar.length}
|
||||
</Text>
|
||||
</Group>
|
||||
{visible && <ComponentGlobal_CardLoadingOverlay />}
|
||||
</Stack>
|
||||
</ComponentGlobal_CardStyles>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user