fix:
Deksripsi: - Progress investasi - Tampilan voting ## No issue
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
UIGlobal_LayoutHeaderTamplate,
|
||||
UIGlobal_LayoutTamplate,
|
||||
} from "@/app_modules/_global/ui";
|
||||
import { Voting_ViewDetailKontributorVoting } from "../../_view";
|
||||
|
||||
export function Voting_UiDetailKontributorVoting({
|
||||
listKontributor,
|
||||
}: {
|
||||
listKontributor: any[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={<UIGlobal_LayoutHeaderTamplate title="Daftar Kontributor" />}
|
||||
>
|
||||
<Voting_ViewDetailKontributorVoting listKontributor={listKontributor} />
|
||||
</UIGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
3
src/app_modules/vote/_ui/index.ts
Normal file
3
src/app_modules/vote/_ui/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { Voting_UiDetailKontributorVoting } from "./detail/ui_detail_kontributor_voting";
|
||||
|
||||
export { Voting_UiDetailKontributorVoting };
|
||||
3
src/app_modules/vote/_view/index.ts
Normal file
3
src/app_modules/vote/_view/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { Voting_ViewDetailKontributorVoting } from "./view_detail_kontributor_voting";
|
||||
|
||||
export { Voting_ViewDetailKontributorVoting };
|
||||
@@ -0,0 +1,63 @@
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { AccentColor } from "@/app_modules/_global/color";
|
||||
import { ComponentGlobal_AvatarAndAuthorName } from "@/app_modules/_global/component";
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
import {
|
||||
Card,
|
||||
Stack,
|
||||
Center,
|
||||
Title,
|
||||
Grid,
|
||||
Avatar,
|
||||
Badge,
|
||||
Divider,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import _ from "lodash";
|
||||
import router from "next/router";
|
||||
import { MODEL_VOTE_KONTRIBUTOR } from "../model/interface";
|
||||
|
||||
export function Voting_ViewDetailKontributorVoting({
|
||||
listKontributor,
|
||||
}: {
|
||||
listKontributor: MODEL_VOTE_KONTRIBUTOR[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
p={30}
|
||||
style={{
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
borderRadius: "10px",
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
color: "white",
|
||||
}}
|
||||
>
|
||||
<Card.Section>
|
||||
{_.isEmpty(listKontributor) ? (
|
||||
<ComponentGlobal_IsEmptyData text="Tidak ada kontributor" />
|
||||
) : (
|
||||
<Stack>
|
||||
{listKontributor?.map((e, i) => (
|
||||
<ComponentGlobal_AvatarAndAuthorName
|
||||
key={e.id}
|
||||
dataUser={e.Author}
|
||||
componentRight={
|
||||
<Badge w={130}>
|
||||
<Text
|
||||
lineClamp={1}
|
||||
fz={e.Voting_DaftarNamaVote.value.length > 10 ? 8 : 10}
|
||||
>
|
||||
{e.Voting_DaftarNamaVote.value}
|
||||
</Text>
|
||||
</Badge>
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</Stack>
|
||||
)}
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -22,6 +22,8 @@ import { MODEL_VOTING } from "../model/interface";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { toNumber } from "lodash";
|
||||
import { useState } from "react";
|
||||
import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component";
|
||||
|
||||
export default function ComponentVote_CardViewPublish({
|
||||
data,
|
||||
@@ -29,14 +31,18 @@ export default function ComponentVote_CardViewPublish({
|
||||
pilihanSaya,
|
||||
authorName,
|
||||
namaPilihan,
|
||||
statusArsip,
|
||||
}: {
|
||||
data?: MODEL_VOTING;
|
||||
path: string;
|
||||
pilihanSaya?: boolean;
|
||||
authorName?: boolean;
|
||||
namaPilihan?: string;
|
||||
statusArsip?: boolean;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
@@ -70,8 +76,9 @@ export default function ComponentVote_CardViewPublish({
|
||||
py={authorName ? "sm" : 0}
|
||||
onClick={() => {
|
||||
if (data?.id === undefined) {
|
||||
ComponentGlobal_NotifikasiPeringatan("Path tidak ditemukan");
|
||||
ComponentGlobal_NotifikasiPeringatan("Halaman tidak ditemukan");
|
||||
} else {
|
||||
setVisible(true);
|
||||
router.push(path + data?.id);
|
||||
}
|
||||
}}
|
||||
@@ -112,21 +119,38 @@ export default function ComponentVote_CardViewPublish({
|
||||
</Stack>
|
||||
{data ? (
|
||||
<Stack>
|
||||
{data?.Voting_DaftarNamaVote.map((v, i) => (
|
||||
<Stack key={v.id} spacing={0}>
|
||||
<Group position="apart">
|
||||
<Text>{v.value}</Text>
|
||||
<Text>{v.jumlah}</Text>
|
||||
</Group>
|
||||
<Progress size={"xl"} radius={"xl"} value={v.jumlah} color="yellow" />
|
||||
</Stack>
|
||||
|
||||
))}
|
||||
<Center>
|
||||
<Title order={5}>Hasil Voting</Title>
|
||||
</Center>
|
||||
|
||||
<Grid justify="center">
|
||||
{data?.Voting_DaftarNamaVote.map((e) => (
|
||||
<Grid.Col
|
||||
key={e.id}
|
||||
span={data?.Voting_DaftarNamaVote?.length >= 4 ? 6 : 4}
|
||||
>
|
||||
<Stack align="center">
|
||||
<Avatar
|
||||
radius={100}
|
||||
size={70}
|
||||
variant="outline"
|
||||
color="yellow"
|
||||
>
|
||||
<Text>{e.jumlah}</Text>
|
||||
</Avatar>
|
||||
<Text fz={"xs"} align="center">
|
||||
{e.value}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
))}
|
||||
</Grid>
|
||||
</Stack>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Stack>
|
||||
|
||||
{pilihanSaya ? (
|
||||
<Stack align="center" spacing={0} mt="md">
|
||||
<Text mb={"xs"} fw={"bold"} fz={"xs"}>
|
||||
@@ -141,6 +165,18 @@ export default function ComponentVote_CardViewPublish({
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
|
||||
{statusArsip ? (
|
||||
<Center mt="md">
|
||||
<Badge color={data?.isArsip ? "gray" : "green"}>
|
||||
{data?.isArsip ? "Arsip" : "Publish"}
|
||||
</Badge>
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
|
||||
{visible && <ComponentGlobal_CardLoadingOverlay />}
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
|
||||
@@ -0,0 +1,244 @@
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import { AccentColor } from "@/app_modules/_global/color";
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
import { UIGlobal_Modal } from "@/app_modules/_global/ui";
|
||||
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import {
|
||||
ActionIcon,
|
||||
Button,
|
||||
Drawer,
|
||||
Group,
|
||||
SimpleGrid,
|
||||
Stack,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { IconArchive, IconUsersGroup, IconX } from "@tabler/icons-react";
|
||||
import { IconDots, IconDotsVertical } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { voting_funGetOneVotingbyId } from "../../fun/get/fun_get_one_by_id";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import { voting_funUpdateIsArsipById } from "../../fun";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
|
||||
export function Voting_ComponentLayoutHeaderDetailPublish({
|
||||
votingId,
|
||||
title,
|
||||
userLoginId,
|
||||
}: {
|
||||
votingId: string;
|
||||
title: string;
|
||||
userLoginId: string;
|
||||
}) {
|
||||
const [data, setData] = useState<MODEL_VOTING>();
|
||||
const [openDrawer, setOpenDrawer] = useState(false);
|
||||
const [openModal, setOpenModal] = useState(false);
|
||||
|
||||
useShallowEffect(() => {
|
||||
onLoadData({ onSetData: setData });
|
||||
}, [setData]);
|
||||
|
||||
async function onLoadData({ onSetData }: { onSetData: any }) {
|
||||
const dataVoting = await voting_funGetOneVotingbyId(votingId);
|
||||
onSetData(dataVoting);
|
||||
}
|
||||
|
||||
async function onUpdateStatusArsip({ isArsip }: { isArsip: boolean }) {
|
||||
const res = await voting_funUpdateIsArsipById({
|
||||
votingId,
|
||||
isArsip: isArsip,
|
||||
});
|
||||
if (res.status === 200) {
|
||||
setOpenModal(false);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<UIGlobal_LayoutHeaderTamplate
|
||||
title={title}
|
||||
customButtonRight={
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
onClick={() => {
|
||||
setOpenDrawer(true);
|
||||
}}
|
||||
>
|
||||
<IconDotsVertical color="white" />
|
||||
</ActionIcon>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Drawer */}
|
||||
<Drawer
|
||||
opened={openDrawer}
|
||||
onClose={() => setOpenDrawer(false)}
|
||||
position={"bottom"}
|
||||
size={"auto"}
|
||||
withCloseButton={false}
|
||||
styles={{
|
||||
content: {
|
||||
padding: 0,
|
||||
position: "absolute",
|
||||
margin: "auto",
|
||||
backgroundColor: "transparent",
|
||||
left: 0,
|
||||
right: 0,
|
||||
width: 500,
|
||||
},
|
||||
body: {
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
borderTop: `2px solid ${AccentColor.blue}`,
|
||||
borderRight: `1px solid ${AccentColor.blue}`,
|
||||
borderLeft: `1px solid ${AccentColor.blue}`,
|
||||
borderRadius: "20px 20px 0px 0px",
|
||||
color: "white",
|
||||
paddingBottom: "5%",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Stack spacing={"xs"}>
|
||||
<Group position="right">
|
||||
<ActionIcon
|
||||
onClick={() => setOpenDrawer(false)}
|
||||
variant="transparent"
|
||||
>
|
||||
<IconX color="white" />
|
||||
</ActionIcon>
|
||||
</Group>
|
||||
|
||||
{/* Check Author */}
|
||||
{data?.authorId === userLoginId ? (
|
||||
<BoxIsAuthor
|
||||
votingId={votingId}
|
||||
onSetDrawer={(val: any) => {
|
||||
setOpenDrawer(val.drawer);
|
||||
setOpenModal(val.modal);
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<BoxNotAuthor votingId={votingId} />
|
||||
)}
|
||||
</Stack>
|
||||
</Drawer>
|
||||
|
||||
{/* Modal */}
|
||||
<UIGlobal_Modal
|
||||
opened={openModal}
|
||||
close={() => setOpenModal(false)}
|
||||
title={`Anda yakin ingin ${data?.isArsip ? "mempublish" : "mengarsipkan"} voting?`}
|
||||
buttonKanan={
|
||||
<Button
|
||||
onClick={() => {
|
||||
data?.isArsip
|
||||
? onUpdateStatusArsip({ isArsip: false })
|
||||
: onUpdateStatusArsip({ isArsip: true });
|
||||
|
||||
// ON UPDATE DISINI
|
||||
}}
|
||||
radius={"xl"}
|
||||
color="green"
|
||||
>
|
||||
Iya
|
||||
</Button>
|
||||
}
|
||||
buttonKiri={
|
||||
<Button onClick={() => setOpenModal(false)} radius={"xl"}>
|
||||
Batal
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function BoxIsAuthor({
|
||||
votingId,
|
||||
onSetDrawer,
|
||||
}: {
|
||||
votingId: string;
|
||||
onSetDrawer: (vaL: any) => void;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<SimpleGrid cols={2}>
|
||||
<Stack align="center" spacing={"xs"}>
|
||||
{/* Daftar Kontributor */}
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
c="white"
|
||||
onClick={() => {
|
||||
setIsLoading(true);
|
||||
router.push(RouterVote.daftar_kontributor + votingId, {
|
||||
scroll: false,
|
||||
});
|
||||
}}
|
||||
>
|
||||
{isLoading ? <ComponentGlobal_Loader /> : <IconUsersGroup />}
|
||||
</ActionIcon>
|
||||
<Text fz={"sm"} align="center" color="white">
|
||||
Daftar Kontributor
|
||||
</Text>
|
||||
</Stack>
|
||||
<Stack align="center" spacing={"xs"}>
|
||||
{/* Arsip button */}
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
c="white"
|
||||
onClick={() => {
|
||||
onSetDrawer({
|
||||
drawer: false,
|
||||
modal: true,
|
||||
});
|
||||
// setOpenModal(true);
|
||||
}}
|
||||
>
|
||||
<IconArchive />
|
||||
</ActionIcon>
|
||||
<Text fz={"sm"} align="center" color="white">
|
||||
Update Arsip
|
||||
</Text>
|
||||
</Stack>
|
||||
</SimpleGrid>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function BoxNotAuthor({ votingId }: { votingId: string }) {
|
||||
const router = useRouter();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [pageId, setPageId] = useState("");
|
||||
|
||||
return (
|
||||
<>
|
||||
<SimpleGrid cols={1}>
|
||||
<Stack align="center" spacing={"xs"}>
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
c="white"
|
||||
onClick={() => {
|
||||
setIsLoading(true);
|
||||
router.push(RouterVote.daftar_kontributor + votingId, {
|
||||
scroll: false,
|
||||
});
|
||||
}}
|
||||
>
|
||||
{isLoading ? <ComponentGlobal_Loader /> : <IconUsersGroup />}
|
||||
</ActionIcon>
|
||||
<Text fz={"sm"} align="center" color="white">
|
||||
Daftar Kontributor
|
||||
</Text>
|
||||
</Stack>
|
||||
</SimpleGrid>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -10,18 +10,19 @@ import {
|
||||
Grid,
|
||||
Stack,
|
||||
Text,
|
||||
Title
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { MODEL_VOTE_KONTRIBUTOR } from "../../model/interface";
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
|
||||
export default function ComponentVote_DaftarKontributorVoter({
|
||||
listKontributor,
|
||||
}: {
|
||||
listKontributor?: MODEL_VOTE_KONTRIBUTOR[];
|
||||
}) {
|
||||
const router = useRouter()
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
@@ -36,15 +37,14 @@ export default function ComponentVote_DaftarKontributorVoter({
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
<Center>
|
||||
<Title order={5}>Daftar Voting</Title>
|
||||
<Title order={5}>Daftar Kontributor</Title>
|
||||
</Center>
|
||||
|
||||
{_.isEmpty(listKontributor) ? (
|
||||
<Center>
|
||||
<Text fz={"xs"} c={"gray"} fw={"bold"}>
|
||||
- Tidak ada voting -
|
||||
</Text>
|
||||
</Center>
|
||||
<ComponentGlobal_IsEmptyData
|
||||
height={20}
|
||||
text="Tidak ada kontributor"
|
||||
/>
|
||||
) : (
|
||||
<Stack>
|
||||
{listKontributor?.map((e, i) => (
|
||||
|
||||
3
src/app_modules/vote/component/index.tsx
Normal file
3
src/app_modules/vote/component/index.tsx
Normal file
@@ -0,0 +1,3 @@
|
||||
import { Voting_ComponentLayoutHeaderDetailPublish } from "./detail/comp_layout_header_detail_publish";
|
||||
|
||||
export { Voting_ComponentLayoutHeaderDetailPublish };
|
||||
@@ -19,10 +19,8 @@ import ComponentVote_DetailDataSetelahPublish from "../../component/detail/detai
|
||||
|
||||
export default function Vote_DetailKontribusi({
|
||||
dataVote,
|
||||
listKontributor,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING;
|
||||
listKontributor: any
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
@@ -32,12 +30,7 @@ export default function Vote_DetailKontribusi({
|
||||
authorName={true}
|
||||
/>
|
||||
<ComponentVote_HasilVoting data={dataVote.Voting_DaftarNamaVote} />
|
||||
<ComponentVote_DaftarKontributorVoter
|
||||
listKontributor={listKontributor}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentVote_HeaderTamplate from "../../component/header_tamplate";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import React from "react";
|
||||
import { Voting_ComponentLayoutHeaderDetailPublish } from "../../component";
|
||||
|
||||
export default function LayoutVote_DetailKontribusi({
|
||||
children,
|
||||
votingId,
|
||||
userLoginId,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
votingId: string;
|
||||
userLoginId: string;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={<UIGlobal_LayoutHeaderTamplate title="Detail Kontribusi" />}
|
||||
header={
|
||||
<Voting_ComponentLayoutHeaderDetailPublish
|
||||
title="Detail Kontribusi"
|
||||
userLoginId={userLoginId}
|
||||
votingId={votingId}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</UIGlobal_LayoutTamplate>
|
||||
|
||||
@@ -25,9 +25,11 @@ import { useState } from "react";
|
||||
import ComponentVote_DaftarKontributorVoter from "../../component/detail/detail_daftar_kontributor";
|
||||
import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
|
||||
import { Vote_funCreateHasil } from "../../fun/create/create_hasil";
|
||||
import { Vote_getOnebyId } from "../../fun/get/get_one_by_id";
|
||||
import { voting_funGetOneVotingbyId } from "../../fun/get/fun_get_one_by_id";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import mqtt_client from "@/util/mqtt_client";
|
||||
import moment from "moment";
|
||||
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||
|
||||
export default function Vote_MainDetail({
|
||||
dataVote,
|
||||
@@ -45,9 +47,16 @@ export default function Vote_MainDetail({
|
||||
userLoginId: string;
|
||||
}) {
|
||||
const [data, setData] = useState(dataVote);
|
||||
const today = new Date();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack py={"md"}>
|
||||
{moment(dataVote?.awalVote).diff(today, "hours") < 0 ? (
|
||||
""
|
||||
) : (
|
||||
<ComponentGlobal_BoxInformation informasi="Untuk sementara voting ini belum di buka. Voting akan dimulai sesuai dengan tanggal awal pemilihan, dan akan ditutup sesuai dengan tanggal akhir pemilihan." />
|
||||
)}
|
||||
<TampilanDataVoting
|
||||
dataVote={data}
|
||||
setData={setData}
|
||||
@@ -56,9 +65,6 @@ export default function Vote_MainDetail({
|
||||
userLoginId={userLoginId}
|
||||
/>
|
||||
<ComponentVote_HasilVoting data={data.Voting_DaftarNamaVote} />
|
||||
<ComponentVote_DaftarKontributorVoter
|
||||
listKontributor={listKontributor}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
@@ -78,6 +84,8 @@ function TampilanDataVoting({
|
||||
userLoginId: string;
|
||||
}) {
|
||||
const [votingNameId, setVotingNameId] = useState("");
|
||||
const today = new Date();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
@@ -184,6 +192,11 @@ function TampilanDataVoting({
|
||||
{dataVote?.Voting_DaftarNamaVote.map((v) => (
|
||||
<Box key={v.id}>
|
||||
<Radio
|
||||
disabled={
|
||||
moment(dataVote?.awalVote).diff(today, "hours") < 0
|
||||
? false
|
||||
: true
|
||||
}
|
||||
color="yellow"
|
||||
styles={{ label: { color: "white" } }}
|
||||
label={v.value}
|
||||
@@ -233,11 +246,11 @@ async function onVote(
|
||||
) {
|
||||
const res = await Vote_funCreateHasil(pilihanVotingId, voteId);
|
||||
if (res.status === 201) {
|
||||
await Vote_getOnebyId(voteId).then((val) => {
|
||||
await voting_funGetOneVotingbyId(voteId).then((val) => {
|
||||
setData(val);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
});
|
||||
|
||||
|
||||
if (userLoginId !== res?.data?.Voting?.authorId) {
|
||||
const dataNotif = {
|
||||
appId: res?.data?.Voting?.id,
|
||||
@@ -262,8 +275,6 @@ async function onVote(
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentVote_HeaderTamplate from "../../component/header_tamplate";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import React from "react";
|
||||
import { Voting_ComponentLayoutHeaderDetailPublish } from "../../component";
|
||||
|
||||
export default function LayoutVote_MainDetail({
|
||||
children,
|
||||
votingId,
|
||||
userLoginId,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
votingId: string;
|
||||
userLoginId: string;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={<UIGlobal_LayoutHeaderTamplate title="Detail Voting" />}
|
||||
header={
|
||||
<Voting_ComponentLayoutHeaderDetailPublish
|
||||
title="Detail Voting"
|
||||
votingId={votingId}
|
||||
userLoginId={userLoginId}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</UIGlobal_LayoutTamplate>
|
||||
|
||||
@@ -1,81 +1,27 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Badge,
|
||||
Card,
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
Radio,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import ComponentVote_DetailDataSebelumPublish from "../../component/detail/detail_data_sebelum_publish";
|
||||
import { Badge, Center, Stack } from "@mantine/core";
|
||||
import ComponentVote_DaftarKontributorVoter from "../../component/detail/detail_daftar_kontributor";
|
||||
import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
|
||||
import moment from "moment";
|
||||
import { MODEL_VOTE_KONTRIBUTOR, MODEL_VOTING } from "../../model/interface";
|
||||
import ComponentVote_DetailDataSetelahPublish from "../../component/detail/detail_data_setelah_publish";
|
||||
import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
|
||||
import { MODEL_VOTE_KONTRIBUTOR, MODEL_VOTING } from "../../model/interface";
|
||||
|
||||
export default function Vote_DetailPublish({
|
||||
dataVote,
|
||||
listKontributor,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING;
|
||||
listKontributor: MODEL_VOTE_KONTRIBUTOR;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack py={"md"}>
|
||||
{/* <ComponentVote_DetailStatus /> */}
|
||||
<Center >
|
||||
<Badge color={dataVote?.isArsip ? "gray" : "green"}>
|
||||
{dataVote?.isArsip ? "Arsip" : "Publish"}
|
||||
</Badge>
|
||||
</Center>
|
||||
<ComponentVote_DetailDataSetelahPublish data={dataVote} />
|
||||
<ComponentVote_HasilVoting data={dataVote.Voting_DaftarNamaVote} />
|
||||
<ComponentVote_DaftarKontributorVoter
|
||||
listKontributor={listKontributor as any}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TampilanDataVoting({ data }: { data: MODEL_VOTING }) {
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
<Card.Section px={"xs"}>
|
||||
<Stack spacing={"lg"}>
|
||||
<Center>
|
||||
<Title order={5}>{data.title}</Title>
|
||||
</Center>
|
||||
<Text>{data.deskripsi}</Text>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
<Card.Section py={"lg"}>
|
||||
<Stack spacing={0}>
|
||||
<Center>
|
||||
<Text fz={10} fw={"bold"}>
|
||||
Batas Voting
|
||||
</Text>
|
||||
</Center>
|
||||
<Badge>
|
||||
<Group>
|
||||
<Text>
|
||||
{data.awalVote.toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "long",
|
||||
})}
|
||||
</Text>
|
||||
<Text>-</Text>
|
||||
<Text>
|
||||
{data.akhirVote.toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "long",
|
||||
})}
|
||||
</Text>
|
||||
</Group>
|
||||
</Badge>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentVote_HeaderTamplate from "../../component/header_tamplate";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import React from "react";
|
||||
import { Voting_ComponentLayoutHeaderDetailPublish } from "../../component";
|
||||
|
||||
export default function LayoutVote_DetailPublish({
|
||||
children,
|
||||
votingId,
|
||||
userLoginId,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
votingId: string;
|
||||
userLoginId: string;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={<UIGlobal_LayoutHeaderTamplate title="Detail Publish" />}
|
||||
header={
|
||||
<Voting_ComponentLayoutHeaderDetailPublish
|
||||
title="Detail Publish"
|
||||
votingId={votingId}
|
||||
userLoginId={userLoginId}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</UIGlobal_LayoutTamplate>
|
||||
|
||||
@@ -6,8 +6,12 @@ import React from "react";
|
||||
|
||||
export default function LayoutVote_DetailSemuaRiwayat({
|
||||
children,
|
||||
votingId,
|
||||
userLoginId,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
votingId: string;
|
||||
userLoginId: string;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function Vote_funCreateHasil(
|
||||
pilihanVotingId: string,
|
||||
votingId: string
|
||||
) {
|
||||
const authorId = await user_getOneUserId();
|
||||
const authorId = await user_funGetOneUserId();
|
||||
|
||||
const get = await prisma.voting_DaftarNamaVote.findFirst({
|
||||
where: {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function Vote_funCreatePilihanVotingById(
|
||||
namaVotingId: string,
|
||||
votingId: string
|
||||
) {
|
||||
const authorId = await user_getOneUserId();
|
||||
const authorId = await user_funGetOneUserId();
|
||||
|
||||
const create = await prisma.voting_Kontributor.create({
|
||||
data: {
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
"use server";
|
||||
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import _ from "lodash";
|
||||
|
||||
export async function Vote_funCreate(req: MODEL_VOTING, listVote: any[]) {
|
||||
const authorId = await user_getOneUserId();
|
||||
const authorId = await user_funGetOneUserId();
|
||||
|
||||
const create = await prisma.voting.create({
|
||||
data: {
|
||||
title: req.title,
|
||||
title: _.startCase(req.title),
|
||||
deskripsi: req.deskripsi,
|
||||
awalVote: req.awalVote,
|
||||
akhirVote: req.akhirVote,
|
||||
|
||||
28
src/app_modules/vote/fun/edit/fun_update_is_arsip_by_id.ts
Normal file
28
src/app_modules/vote/fun/edit/fun_update_is_arsip_by_id.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function voting_funUpdateIsArsipById({
|
||||
votingId,
|
||||
isArsip,
|
||||
}: {
|
||||
votingId: string;
|
||||
isArsip: boolean;
|
||||
}) {
|
||||
const updt = await prisma.voting.update({
|
||||
where: {
|
||||
id: votingId,
|
||||
},
|
||||
data: {
|
||||
isArsip: isArsip,
|
||||
},
|
||||
});
|
||||
|
||||
if (!updt) return { status: 400, message: "Gagal Update" };
|
||||
revalidatePath(RouterVote.main_detail);
|
||||
revalidatePath(RouterVote.detail_publish);
|
||||
|
||||
return { status: 200, message: "Berhasil Update" };
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Vote_cekKontributorById(votingId: string) {
|
||||
const UserId = await user_getOneUserId()
|
||||
const UserId = await user_funGetOneUserId()
|
||||
|
||||
const cek = await prisma.voting_Kontributor.count({
|
||||
where: {
|
||||
|
||||
@@ -2,23 +2,12 @@
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function Vote_getOnebyId(voteId: string) {
|
||||
export async function voting_funGetOneVotingbyId(voteId: string) {
|
||||
const data = await prisma.voting.findFirst({
|
||||
where: {
|
||||
id: voteId,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
deskripsi: true,
|
||||
awalVote: true,
|
||||
akhirVote: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
voting_StatusId: true,
|
||||
include: {
|
||||
Voting_DaftarNamaVote: {
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
@@ -1,9 +1,15 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function vote_getAllListPublish({ page }: { page: number }) {
|
||||
export async function vote_getAllListPublish({
|
||||
page,
|
||||
search,
|
||||
}: {
|
||||
page: number;
|
||||
search?: string;
|
||||
}) {
|
||||
const takeData = 5;
|
||||
const skipData = page * takeData - takeData;
|
||||
|
||||
@@ -15,10 +21,15 @@ export async function vote_getAllListPublish({ page }: { page: number }) {
|
||||
},
|
||||
where: {
|
||||
voting_StatusId: "1",
|
||||
isArsip: false,
|
||||
isActive: true,
|
||||
akhirVote: {
|
||||
gte: new Date(),
|
||||
},
|
||||
title: {
|
||||
contains: search,
|
||||
mode: "insensitive",
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
@@ -36,6 +47,13 @@ export async function vote_getAllListPublish({ page }: { page: number }) {
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
},
|
||||
include: {
|
||||
Voting_Kontributor: {
|
||||
include: {
|
||||
Author: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Author: {
|
||||
select: {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function Vote_getAllListRiwayatSaya({ page }: { page: number }) {
|
||||
const authorId = await user_getOneUserId();
|
||||
const authorId = await user_funGetOneUserId();
|
||||
const takeData = 5;
|
||||
const skipData = page * takeData - takeData;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function vote_getAllListKontribusiByAuthorId({
|
||||
page,
|
||||
@@ -11,7 +11,7 @@ export async function vote_getAllListKontribusiByAuthorId({
|
||||
const takeData = 5;
|
||||
const skipData = page * takeData - takeData;
|
||||
|
||||
const authorId = await user_getOneUserId();
|
||||
const authorId = await user_funGetOneUserId();
|
||||
const data = await prisma.voting_Kontributor.findMany({
|
||||
take: takeData,
|
||||
skip: skipData,
|
||||
|
||||
@@ -7,10 +7,9 @@ export async function Vote_getListKontributorById(votingId: string) {
|
||||
where: {
|
||||
votingId: votingId,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
include: {
|
||||
Author: {
|
||||
select: {
|
||||
include: {
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Vote_getOnePilihanVotingByUserId(votingId: string) {
|
||||
const userId = await user_getOneUserId();
|
||||
const userId = await user_funGetOneUserId();
|
||||
const get = await prisma.voting_Kontributor.findFirst({
|
||||
where: {
|
||||
authorId: userId,
|
||||
|
||||
3
src/app_modules/vote/fun/get/index.ts
Normal file
3
src/app_modules/vote/fun/get/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { voting_funGetOneVotingbyId } from "./fun_get_one_by_id";
|
||||
|
||||
export { voting_funGetOneVotingbyId as Voting_funGetOneVotingbyId };
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function vote_getAllDraft({ page }: { page: number }) {
|
||||
const authorId = await user_getOneUserId();
|
||||
const authorId = await user_funGetOneUserId();
|
||||
|
||||
const takeData = 10;
|
||||
const skipData = page * takeData - takeData;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function vote_getAllPublish({ page }: { page: number }) {
|
||||
const authorId = await user_getOneUserId();
|
||||
const authorId = await user_funGetOneUserId();
|
||||
|
||||
const takeData = 5;
|
||||
const skipData = page * takeData - takeData;
|
||||
@@ -23,18 +23,7 @@ export async function vote_getAllPublish({ page }: { page: number }) {
|
||||
gte: new Date(),
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
deskripsi: true,
|
||||
awalVote: true,
|
||||
akhirVote: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
voting_StatusId: true,
|
||||
include: {
|
||||
Voting_DaftarNamaVote: {
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
@@ -43,5 +32,6 @@ export async function vote_getAllPublish({ page }: { page: number }) {
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function vote_getAllReject({ page }: { page: number }) {
|
||||
const authorId = await user_getOneUserId();
|
||||
const authorId = await user_funGetOneUserId();
|
||||
|
||||
const takeData = 10;
|
||||
const skipData = page * takeData - takeData;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function vote_getAllReview({ page }: { page: number }) {
|
||||
const authorId = await user_getOneUserId();
|
||||
const authorId = await user_funGetOneUserId();
|
||||
|
||||
const takeData = 10;
|
||||
const skipData = page * takeData - takeData;
|
||||
|
||||
3
src/app_modules/vote/fun/index.ts
Normal file
3
src/app_modules/vote/fun/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { voting_funUpdateIsArsipById } from "./edit/fun_update_is_arsip_by_id";
|
||||
|
||||
export { voting_funUpdateIsArsipById };
|
||||
@@ -3,7 +3,7 @@
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
import { Box, Center, Loader } from "@mantine/core";
|
||||
import { Box, Center, Loader, Stack, TextInput } from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import _ from "lodash";
|
||||
import { ScrollOnly } from "next-scroll-loader";
|
||||
@@ -22,19 +22,30 @@ export default function Vote_Beranda({
|
||||
|
||||
useShallowEffect(() => {
|
||||
onLoad({
|
||||
setData(val) {
|
||||
newData(val) {
|
||||
setData(val);
|
||||
},
|
||||
});
|
||||
}, [setData]);
|
||||
|
||||
async function onLoad({ setData }: { setData: (val: any) => void }) {
|
||||
async function onLoad({ newData }: { newData: (val: any) => void }) {
|
||||
const loadData = await vote_getAllListPublish({ page: 1 });
|
||||
setData(loadData);
|
||||
newData(loadData);
|
||||
}
|
||||
|
||||
async function onSearch(s: string) {
|
||||
const loadSearch = await vote_getAllListPublish({ page: 1, search: s });
|
||||
setData(loadSearch as any);
|
||||
}
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<Stack mt={"1vh"}>
|
||||
<TextInput
|
||||
radius={"xl"}
|
||||
placeholder="Masukan judul voting"
|
||||
onChange={(val) => onSearch(val.target.value)}
|
||||
/>
|
||||
|
||||
<ComponentGlobal_CreateButton path={RouterVote.create} />
|
||||
|
||||
{_.isEmpty(data) ? (
|
||||
@@ -42,7 +53,7 @@ export default function Vote_Beranda({
|
||||
) : (
|
||||
<Box>
|
||||
<ScrollOnly
|
||||
height="82vh"
|
||||
height="75vh"
|
||||
renderLoading={() => (
|
||||
<Center mt={"lg"}>
|
||||
<Loader color={"yellow"} />
|
||||
@@ -69,8 +80,7 @@ export default function Vote_Beranda({
|
||||
)}
|
||||
</ScrollOnly>
|
||||
</Box>
|
||||
// --- Main component --- //
|
||||
)}
|
||||
</Box>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ export default function Vote_Status({
|
||||
listDraft: any[];
|
||||
listReject: any[];
|
||||
}) {
|
||||
|
||||
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
|
||||
const listTabs = [
|
||||
{
|
||||
@@ -73,6 +72,7 @@ export default function Vote_Status({
|
||||
<Tabs.List grow>
|
||||
{listTabs.map((e) => (
|
||||
<Tabs.Tab
|
||||
w={"20%"}
|
||||
key={e.id}
|
||||
value={e.value}
|
||||
fw={"bold"}
|
||||
@@ -81,10 +81,6 @@ export default function Vote_Status({
|
||||
transition: "0.5s",
|
||||
backgroundColor:
|
||||
tabsStatus === e.value ? MainColor.yellow : "white",
|
||||
border:
|
||||
tabsStatus === e.value
|
||||
? `1px solid ${AccentColor.yellow}`
|
||||
: `1px solid white`,
|
||||
}}
|
||||
>
|
||||
{e.value}
|
||||
|
||||
@@ -47,6 +47,7 @@ export default function Vote_StatusPublish({
|
||||
<ComponentVote_CardViewPublish
|
||||
data={item}
|
||||
path={RouterVote.detail_publish}
|
||||
statusArsip
|
||||
/>
|
||||
)}
|
||||
</ScrollOnly>
|
||||
|
||||
@@ -13,6 +13,7 @@ export interface MODEL_VOTING {
|
||||
authorId: string;
|
||||
Author: MODEL_USER;
|
||||
Voting_DaftarNamaVote: MODEL_VOTING_DAFTAR_NAMA_VOTE[];
|
||||
isArsip: boolean;
|
||||
}
|
||||
|
||||
export interface MODEL_VOTING_DAFTAR_NAMA_VOTE {
|
||||
|
||||
Reference in New Issue
Block a user