# Voting
## feat - Voting user - Halaman kontribusi - Halaman riwayat ### No issuue
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
import { MODEL_VOTING } from "@/app_modules/vote/model/interface";
|
||||
import {
|
||||
Stack,
|
||||
Center,
|
||||
@@ -20,24 +22,29 @@ import {
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconBan, IconEyeCheck } from "@tabler/icons-react";
|
||||
import { IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminVote_Riwayat() {
|
||||
export default function AdminVote_Riwayat({
|
||||
dataVote,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Voting: Table Riwayat" />
|
||||
<TableStatus listPublish={[]} />
|
||||
<TableStatus listPublish={dataVote} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listPublish }: { listPublish: any[] }) {
|
||||
function TableStatus({ listPublish }: { listPublish: MODEL_VOTING[] }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listPublish);
|
||||
@@ -47,45 +54,50 @@ function TableStatus({ listPublish }: { listPublish: any[] }) {
|
||||
|
||||
const TableRows = data.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Center>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="green"
|
||||
leftIcon={<IconEyeCheck />}
|
||||
onClick={() => ComponentGlobal_NotifikasiPeringatan("On Process")}
|
||||
>
|
||||
Hasil Voting
|
||||
</Button>
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>{e.title}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
maw={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.deskripsi}
|
||||
</Spoiler>
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>Mulai vote</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>Selesai vote</Center>
|
||||
</td>
|
||||
|
||||
<th>
|
||||
<Stack>
|
||||
{e.Voting_DaftarNamaVote.map((v) => (
|
||||
<Box key={v.id}>
|
||||
<Text>- {v.value}</Text>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</th>
|
||||
<td>
|
||||
<Center>
|
||||
<Button
|
||||
loading={
|
||||
e.id === eventId ? (loading === true ? true : false) : false
|
||||
}
|
||||
color={"green"}
|
||||
leftIcon={<IconEyeShare />}
|
||||
radius={"xl"}
|
||||
onClick={async () => {
|
||||
setEventId(e.id);
|
||||
setLoading(true);
|
||||
await new Promise((v) => setTimeout(v, 500));
|
||||
await AdminEvent_getListPesertaById(e.id).then((res: any) => {
|
||||
setPeserta(res);
|
||||
setLoading(false);
|
||||
});
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Hasil Voting
|
||||
</Button>
|
||||
{e.awalVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
{e.akhirVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -142,22 +154,24 @@ function TableStatus({ listPublish }: { listPublish: any[] }) {
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Pilihan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Mulai Vote</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Selesai Vote</Center>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
@@ -3,10 +3,12 @@
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
import {
|
||||
MODEL_EVENT,
|
||||
MODEL_EVENT_PESERTA,
|
||||
} from "@/app_modules/event/model/interface";
|
||||
import { MODEL_VOTING } from "@/app_modules/vote/model/interface";
|
||||
import {
|
||||
Avatar,
|
||||
Box,
|
||||
@@ -24,23 +26,27 @@ import {
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconEyeShare } from "@tabler/icons-react";
|
||||
import { IconEyeCheck, IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminVote_TablePublish() {
|
||||
export default function AdminVote_TablePublish({
|
||||
dataVote,
|
||||
}: {
|
||||
dataVote: any;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Voting: Table Publish" />
|
||||
<TableStatus listPublish={[]} />
|
||||
<TableStatus listPublish={dataVote} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listPublish }: { listPublish: any[] }) {
|
||||
function TableStatus({ listPublish }: { listPublish: MODEL_VOTING[] }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listPublish);
|
||||
@@ -50,45 +56,50 @@ function TableStatus({ listPublish }: { listPublish: any[] }) {
|
||||
|
||||
const TableRows = data.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Center>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="green"
|
||||
leftIcon={<IconEyeCheck />}
|
||||
onClick={() => ComponentGlobal_NotifikasiPeringatan("On Process")}
|
||||
>
|
||||
Lihat Hasil
|
||||
</Button>
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>{e.title}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
maw={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.deskripsi}
|
||||
</Spoiler>
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>Mulai vote</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>Selesai vote</Center>
|
||||
</td>
|
||||
|
||||
<th>
|
||||
<Stack>
|
||||
{e.Voting_DaftarNamaVote.map((v) => (
|
||||
<Box key={v.id}>
|
||||
<Text>- {v.value}</Text>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</th>
|
||||
<td>
|
||||
<Center>
|
||||
<Button
|
||||
loading={
|
||||
e.id === eventId ? (loading === true ? true : false) : false
|
||||
}
|
||||
color={"green"}
|
||||
leftIcon={<IconEyeShare />}
|
||||
radius={"xl"}
|
||||
onClick={async () => {
|
||||
setEventId(e.id);
|
||||
setLoading(true);
|
||||
await new Promise((v) => setTimeout(v, 500));
|
||||
await AdminEvent_getListPesertaById(e.id).then((res: any) => {
|
||||
setPeserta(res);
|
||||
setLoading(false);
|
||||
});
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Hasil Voting
|
||||
</Button>
|
||||
{e.awalVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
{e.akhirVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -145,22 +156,24 @@ function TableStatus({ listPublish }: { listPublish: any[] }) {
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Pilihan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Mulai Vote</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Selesai Vote</Center>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
242
src/app_modules/admin/vote/child/table_reject/index.tsx
Normal file
242
src/app_modules/admin/vote/child/table_reject/index.tsx
Normal file
@@ -0,0 +1,242 @@
|
||||
"use client";
|
||||
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id";
|
||||
import { MODEL_VOTING } from "@/app_modules/vote/model/interface";
|
||||
import {
|
||||
Avatar,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Modal,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Table,
|
||||
Text,
|
||||
Textarea,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconBan, IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { AdminVote_funEditCatatanRejectById } from "../../fun/edit/fun_edit_catatan_reject_by_id";
|
||||
import { AdminVote_getListTableByStatusId } from "../../fun/get/get_list_table_by_status_id";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
|
||||
export default function AdminVote_TableReject({
|
||||
dataVote,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Voting: Table Reject" />
|
||||
<TableStatus listData={dataVote} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listData }: { listData: MODEL_VOTING[] }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listData);
|
||||
const [votingId, setVotingId] = useState("");
|
||||
const [catatan, setCatatan] = useState("");
|
||||
|
||||
const TableRows = data.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Center>
|
||||
<Button
|
||||
color={"red"}
|
||||
leftIcon={<IconBan />}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
open();
|
||||
setVotingId(e.id);
|
||||
setCatatan(e.catatan);
|
||||
}}
|
||||
>
|
||||
<Stack spacing={0}>
|
||||
<Text fz={10}>Tambah</Text>
|
||||
<Text fz={10}>Catatan</Text>
|
||||
</Stack>
|
||||
</Button>
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
maw={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.catatan}
|
||||
</Spoiler>
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>{e.title}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
maw={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.deskripsi}
|
||||
</Spoiler>
|
||||
</Center>
|
||||
</td>
|
||||
<th>
|
||||
<Stack>
|
||||
{e.Voting_DaftarNamaVote.map((v) => (
|
||||
<Box key={v.id}>
|
||||
<Text>- {v.value}</Text>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</th>
|
||||
<td>
|
||||
<Center>
|
||||
{e.awalVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
{e.akhirVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
</tr>
|
||||
));
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
opened={opened}
|
||||
onClose={close}
|
||||
centered
|
||||
withCloseButton={false}
|
||||
size={"lg"}
|
||||
>
|
||||
<Stack>
|
||||
<Textarea
|
||||
minRows={2}
|
||||
maxRows={5}
|
||||
maxLength={300}
|
||||
autosize
|
||||
label="Masukan Alasan Penolakan"
|
||||
placeholder="Contoh: Karena deskripsi kurang lengkap, dll"
|
||||
value={catatan}
|
||||
onChange={(val) => {
|
||||
setCatatan(val.target.value);
|
||||
}}
|
||||
/>
|
||||
<Group position="right">
|
||||
<Button
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onReject(votingId, catatan, close, setData);
|
||||
console.log(catatan);
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
|
||||
<Box>
|
||||
<Box bg={"red.1"} p={"xs"}>
|
||||
<Title order={6} c={"red"}>
|
||||
REJECT
|
||||
</Title>
|
||||
</Box>
|
||||
<ScrollArea w={"100%"}>
|
||||
<Box w={2000}>
|
||||
<Table
|
||||
withBorder
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"xl"}
|
||||
p={"md"}
|
||||
striped
|
||||
highlightOnHover
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Catatan</Center>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Pilihan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Mulai Vote</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Selesai Vote</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
</Table>
|
||||
</Box>
|
||||
</ScrollArea>
|
||||
<Center>
|
||||
{_.isEmpty(TableRows) ? (
|
||||
<Center h={"50vh"}>
|
||||
<Title order={6}>Tidak Ada Data</Title>
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
async function onReject(
|
||||
votingId: string,
|
||||
catatan: string,
|
||||
close: any,
|
||||
setData: any
|
||||
) {
|
||||
await AdminVote_funEditCatatanRejectById(votingId, catatan).then(
|
||||
async (res) => {
|
||||
if (res.status === 200) {
|
||||
await AdminVote_getListTableByStatusId("4").then((val) => {
|
||||
setData(val);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
close();
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
253
src/app_modules/admin/vote/child/table_review/index.tsx
Normal file
253
src/app_modules/admin/vote/child/table_review/index.tsx
Normal file
@@ -0,0 +1,253 @@
|
||||
"use client";
|
||||
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id";
|
||||
import { MODEL_VOTING } from "@/app_modules/vote/model/interface";
|
||||
import {
|
||||
Avatar,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Modal,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Table,
|
||||
Text,
|
||||
Textarea,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconBan } from "@tabler/icons-react";
|
||||
import { IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import { useState } from "react";
|
||||
import { AdminVote_funEditStatusPublishById } from "../../fun/edit/fun_edit_status_publish_by_id";
|
||||
import toast from "react-simple-toasts";
|
||||
import { AdminVote_getListTableByStatusId } from "../../fun/get/get_list_table_by_status_id";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { AdminEvent_funEditCatatanById } from "../../fun/edit/fun_edit_status_reject_by_id";
|
||||
|
||||
export default function AdminVote_TableReview({
|
||||
listVote,
|
||||
}: {
|
||||
listVote: MODEL_VOTING[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Voting: Table Review" />
|
||||
<TableStatus listData={listVote} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listData }: { listData: MODEL_VOTING[] }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listData);
|
||||
const [votingId, setVotingId] = useState("");
|
||||
const [catatan, setCatatan] = useState("");
|
||||
|
||||
const TableRows = data.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Center>{e.title}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
maw={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.deskripsi}
|
||||
</Spoiler>
|
||||
</Center>
|
||||
</td>
|
||||
<th>
|
||||
<Stack>
|
||||
{e.Voting_DaftarNamaVote.map((v) => (
|
||||
<Box key={v.id}>
|
||||
<Text>- {v.value}</Text>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</th>
|
||||
<td>
|
||||
<Center>
|
||||
{e.awalVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
{e.akhirVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<Stack align="center">
|
||||
<Button
|
||||
w={120}
|
||||
color={"green"}
|
||||
leftIcon={<IconEyeShare />}
|
||||
radius={"xl"}
|
||||
onClick={() => onPublish(e.id, setData)}
|
||||
>
|
||||
Publish
|
||||
</Button>
|
||||
<Button
|
||||
w={120}
|
||||
color={"red"}
|
||||
leftIcon={<IconBan />}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
open();
|
||||
setVotingId(e.id);
|
||||
}}
|
||||
>
|
||||
Reject
|
||||
</Button>
|
||||
</Stack>
|
||||
</td>
|
||||
</tr>
|
||||
));
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
opened={opened}
|
||||
onClose={close}
|
||||
centered
|
||||
withCloseButton={false}
|
||||
size={"lg"}
|
||||
>
|
||||
<Stack>
|
||||
<Textarea
|
||||
minRows={2}
|
||||
maxRows={5}
|
||||
maxLength={300}
|
||||
autosize
|
||||
label="Masukan Alasan Penolakan"
|
||||
placeholder="Contoh: Karena deskripsi kurang lengkap, dll"
|
||||
onChange={(val) => {
|
||||
setCatatan(val.target.value);
|
||||
}}
|
||||
/>
|
||||
<Group position="right">
|
||||
<Button
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onReject(votingId, setData, catatan, close);
|
||||
|
||||
// console.log("hehe")
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
|
||||
<Box>
|
||||
<Box bg={"orange.1"} p={"xs"}>
|
||||
<Title order={6} c={"orange"}>
|
||||
REVIEW
|
||||
</Title>
|
||||
</Box>
|
||||
<ScrollArea w={"100%"}>
|
||||
<Box>
|
||||
<Table
|
||||
withBorder
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"xl"}
|
||||
p={"md"}
|
||||
striped
|
||||
highlightOnHover
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Pilihan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Mulai Vote</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Selesai Vote</Center>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
</Table>
|
||||
</Box>
|
||||
</ScrollArea>
|
||||
<Center>
|
||||
{_.isEmpty(TableRows) ? (
|
||||
<Center h={"50vh"}>
|
||||
<Title order={6}>Tidak Ada Data</Title>
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
async function onPublish(voteId: string, setData: any) {
|
||||
await AdminVote_funEditStatusPublishById(voteId).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
await AdminVote_getListTableByStatusId("2").then((val) => {
|
||||
setData(val);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function onReject(
|
||||
voteId: string,
|
||||
setData: any,
|
||||
catatan: string,
|
||||
close: any
|
||||
) {
|
||||
const data = {
|
||||
id: voteId,
|
||||
catatan: catatan,
|
||||
};
|
||||
await AdminEvent_funEditCatatanById(data as any).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
await AdminVote_getListTableByStatusId("2").then((val) => {
|
||||
setData(val);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
close();
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param statusId 0: Riwayat , 1: Publish, 2:Review, 4:Reject
|
||||
* @type string
|
||||
* @returns jumlah dari voting per status
|
||||
*/
|
||||
export default async function AdminVote_funCountByStatusId(statusId: string) {
|
||||
if (statusId === "0") {
|
||||
const count = await prisma.voting.count({
|
||||
where: {
|
||||
voting_StatusId: "1",
|
||||
isActive: true,
|
||||
akhirVote: {
|
||||
lte: new Date(),
|
||||
},
|
||||
},
|
||||
});
|
||||
return count;
|
||||
}
|
||||
if (statusId === "1") {
|
||||
const count = await prisma.voting.count({
|
||||
where: {
|
||||
voting_StatusId: "1",
|
||||
akhirVote: {
|
||||
gte: new Date(),
|
||||
},
|
||||
},
|
||||
});
|
||||
return count;
|
||||
}
|
||||
if (statusId === "2") {
|
||||
const count = await prisma.voting.count({
|
||||
where: {
|
||||
voting_StatusId: "2",
|
||||
// akhirVote: {
|
||||
// gte: new Date(),
|
||||
// },
|
||||
},
|
||||
});
|
||||
return count;
|
||||
}
|
||||
|
||||
if (statusId === "4") {
|
||||
const count = await prisma.voting.count({
|
||||
where: {
|
||||
voting_StatusId: "4",
|
||||
isActive: true,
|
||||
|
||||
// akhirVote: {
|
||||
// gte: new Date(),
|
||||
// },
|
||||
},
|
||||
});
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
if (statusId === undefined || statusId === null) {
|
||||
return {
|
||||
status: 400,
|
||||
message: "Parameter tidak sesuai",
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function AdminVote_funEditCatatanRejectById(
|
||||
voteId: string,
|
||||
catatan: string
|
||||
) {
|
||||
const updt = await prisma.voting.update({
|
||||
where: {
|
||||
id: voteId,
|
||||
},
|
||||
data: {
|
||||
catatan: catatan,
|
||||
},
|
||||
});
|
||||
|
||||
if (!updt) return { status: 400, message: "Gagal Update Catatan" };
|
||||
revalidatePath("/dev/admin/vote/child/table_reject");
|
||||
return { status: 200, message: "Berhasil Update Catatan" };
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function AdminVote_funEditStatusPublishById(voteId: string) {
|
||||
|
||||
const updt = await prisma.voting.update({
|
||||
where: {
|
||||
id: voteId,
|
||||
},
|
||||
data: {
|
||||
voting_StatusId: "1",
|
||||
},
|
||||
});
|
||||
|
||||
if (!updt) return { status: 400, message: "Update Gagal" };
|
||||
revalidatePath("/dev/admin/vote/main");
|
||||
return {
|
||||
status: 200,
|
||||
message: "Berhasil Update Status",
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { MODEL_VOTING } from "@/app_modules/vote/model/interface";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function AdminEvent_funEditCatatanById(
|
||||
data: MODEL_VOTING,
|
||||
) {
|
||||
const updt = await prisma.voting.update({
|
||||
where: {
|
||||
id: data.id,
|
||||
},
|
||||
data: {
|
||||
voting_StatusId: "4",
|
||||
catatan: data.catatan,
|
||||
},
|
||||
});
|
||||
|
||||
if (!updt) return { status: 400, message: "Update Gagal" };
|
||||
revalidatePath("/dev/admin/event/main");
|
||||
return {
|
||||
status: 200,
|
||||
message: "Berhasil Update Status",
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function AdminVote_getListTableByStatusId(statusId: string) {
|
||||
if (statusId === "0") {
|
||||
const getData = await prisma.voting.findMany({
|
||||
where: {
|
||||
voting_StatusId: "1",
|
||||
isActive: true,
|
||||
akhirVote: {
|
||||
lte: new Date(),
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
deskripsi: true,
|
||||
awalVote: true,
|
||||
akhirVote: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
Author: true,
|
||||
voting_StatusId: true,
|
||||
Voting_DaftarNamaVote: true,
|
||||
},
|
||||
});
|
||||
|
||||
return getData;
|
||||
}
|
||||
|
||||
if (statusId === "1") {
|
||||
const getData = await prisma.voting.findMany({
|
||||
where: {
|
||||
voting_StatusId: "1",
|
||||
isActive: true,
|
||||
akhirVote: {
|
||||
gte: new Date(),
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
deskripsi: true,
|
||||
awalVote: true,
|
||||
akhirVote: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
Author: true,
|
||||
voting_StatusId: true,
|
||||
Voting_DaftarNamaVote: true,
|
||||
},
|
||||
});
|
||||
|
||||
return getData;
|
||||
}
|
||||
|
||||
if (statusId === "2") {
|
||||
const getData = await prisma.voting.findMany({
|
||||
where: {
|
||||
voting_StatusId: "2",
|
||||
isActive: true,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
deskripsi: true,
|
||||
awalVote: true,
|
||||
akhirVote: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
Author: true,
|
||||
voting_StatusId: true,
|
||||
Voting_DaftarNamaVote: true,
|
||||
},
|
||||
});
|
||||
|
||||
return getData;
|
||||
}
|
||||
|
||||
if (statusId === "4") {
|
||||
const getData = await prisma.voting.findMany({
|
||||
where: {
|
||||
voting_StatusId: "4",
|
||||
isActive: true,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
deskripsi: true,
|
||||
awalVote: true,
|
||||
akhirVote: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
Author: true,
|
||||
voting_StatusId: true,
|
||||
Voting_DaftarNamaVote: true,
|
||||
},
|
||||
});
|
||||
|
||||
return getData;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -9,14 +9,12 @@ export default function AdminVote_Main({
|
||||
countReview,
|
||||
countDraft,
|
||||
countReject,
|
||||
countTipeAcara,
|
||||
countRiwayat,
|
||||
}: {
|
||||
countPublish?: number;
|
||||
countReview?: number;
|
||||
countDraft?: number;
|
||||
countReject?: number;
|
||||
countTipeAcara?: number;
|
||||
countRiwayat?: number;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
@@ -36,17 +34,17 @@ export default function AdminVote_Main({
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Draft",
|
||||
jumlah: countDraft,
|
||||
path: "",
|
||||
color: "yellow",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "Reject",
|
||||
jumlah: countReject,
|
||||
color: "red",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "Riwayat",
|
||||
jumlah: countDraft,
|
||||
path: "",
|
||||
color: "gray",
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
@@ -1,176 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id";
|
||||
import {
|
||||
Avatar,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Modal,
|
||||
Paper,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Table,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminVote_TableReject() {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Voting: Table Reject" />
|
||||
<TableStatus listData={[]} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listData }: { listData: any[] }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listData);
|
||||
const [peserta, setPeserta] = useState<any[]>();
|
||||
const [eventId, setEventId] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const TableRows = data.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Center>{e.title}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
||||
{e.deskripsi}
|
||||
</Spoiler>
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>Mulai vote</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>Selesai vote</Center>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<Center>
|
||||
<Button
|
||||
loading={
|
||||
e.id === eventId ? (loading === true ? true : false) : false
|
||||
}
|
||||
color={"green"}
|
||||
leftIcon={<IconEyeShare />}
|
||||
radius={"xl"}
|
||||
onClick={async () => {
|
||||
setEventId(e.id);
|
||||
setLoading(true);
|
||||
await new Promise((v) => setTimeout(v, 500));
|
||||
await AdminEvent_getListPesertaById(e.id).then((res: any) => {
|
||||
setPeserta(res);
|
||||
setLoading(false);
|
||||
});
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Hasil Voting
|
||||
</Button>
|
||||
</Center>
|
||||
</td>
|
||||
</tr>
|
||||
));
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal opened={opened} onClose={close}>
|
||||
<Paper>
|
||||
<Stack>
|
||||
<Center>
|
||||
<Title order={3}>Daftar Peserta</Title>
|
||||
</Center>
|
||||
<Stack>
|
||||
{peserta?.map((e) => (
|
||||
<Stack key={e.id} spacing={"xs"}>
|
||||
<Grid>
|
||||
<Grid.Col span={"content"}>
|
||||
<Avatar
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
src={
|
||||
RouterProfile.api_foto_profile +
|
||||
e.User.Profile.imagesId
|
||||
}
|
||||
/>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Group align="center" h={"100%"}>
|
||||
<Text>{e.User.Profile.name}</Text>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Divider />
|
||||
</Stack>
|
||||
))}
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Modal>
|
||||
<Box>
|
||||
<Box bg={"red.1"} p={"xs"}>
|
||||
<Title order={6} c={"red"}>
|
||||
REJECT
|
||||
</Title>
|
||||
</Box>
|
||||
<Table
|
||||
withBorder
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"xl"}
|
||||
p={"md"}
|
||||
striped
|
||||
highlightOnHover
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Mulai Vote</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Selesai Vote</Center>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
</Table>
|
||||
<Center>
|
||||
{_.isEmpty(TableRows) ? (
|
||||
<Center h={"50vh"}>
|
||||
<Title order={6}>Tidak Ada Data</Title>
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,164 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id";
|
||||
import { Avatar, Box, Button, Center, Divider, Grid, Group, Modal, Paper, Spoiler, Stack, Table, Text, Title } from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconBan } from "@tabler/icons-react";
|
||||
import { IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminVote_TableReview() {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Voting: Table Review" />
|
||||
<TableStatus listData={[]}/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listData }: { listData: any[] }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listData);
|
||||
const [peserta, setPeserta] = useState<any[]>();
|
||||
const [eventId, setEventId] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const TableRows = data.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Center>{e.title}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
||||
{e.deskripsi}
|
||||
</Spoiler>
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>Mulai vote</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>Selesai vote</Center>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<Stack align="center">
|
||||
<Button
|
||||
w={150}
|
||||
color={"green"}
|
||||
leftIcon={<IconEyeShare />}
|
||||
radius={"xl"}
|
||||
// onClick={() => onPublish(e.id, setData)}
|
||||
>
|
||||
Publish
|
||||
</Button>
|
||||
<Button
|
||||
w={150}
|
||||
color={"red"}
|
||||
leftIcon={<IconBan />}
|
||||
radius={"xl"}
|
||||
// onClick={() => {
|
||||
// open();
|
||||
// setEventId(e.id);
|
||||
// }}
|
||||
>
|
||||
Reject
|
||||
</Button>
|
||||
</Stack>
|
||||
</td>
|
||||
</tr>
|
||||
));
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal opened={opened} onClose={close}>
|
||||
<Paper>
|
||||
<Stack>
|
||||
<Center>
|
||||
<Title order={3}>Daftar Peserta</Title>
|
||||
</Center>
|
||||
<Stack>
|
||||
{peserta?.map((e) => (
|
||||
<Stack key={e.id} spacing={"xs"}>
|
||||
<Grid>
|
||||
<Grid.Col span={"content"}>
|
||||
<Avatar
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
src={
|
||||
RouterProfile.api_foto_profile +
|
||||
e.User.Profile.imagesId
|
||||
}
|
||||
/>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Group align="center" h={"100%"}>
|
||||
<Text>{e.User.Profile.name}</Text>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Divider />
|
||||
</Stack>
|
||||
))}
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Modal>
|
||||
<Box>
|
||||
<Box bg={"orange.1"} p={"xs"}>
|
||||
<Title order={6} c={"orange"}>
|
||||
REVIEW
|
||||
</Title>
|
||||
</Box>
|
||||
<Table
|
||||
withBorder
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"xl"}
|
||||
p={"md"}
|
||||
striped
|
||||
highlightOnHover
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Mulai Vote</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Selesai Vote</Center>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
</Table>
|
||||
<Center>
|
||||
{_.isEmpty(TableRows) ? (
|
||||
<Center h={"50vh"}>
|
||||
<Title order={6}>Tidak Ada Data</Title>
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -12,9 +12,10 @@ import {
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import _ from "lodash";
|
||||
import router from "next/router";
|
||||
|
||||
import peserta from "../../main/kontribusi/peserta";
|
||||
import { MODEL_EVENT_PESERTA } from "../../model/interface";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function ComponentEvent_ListPeserta({
|
||||
listPeserta,
|
||||
@@ -23,6 +24,7 @@ export default function ComponentEvent_ListPeserta({
|
||||
listPeserta: MODEL_EVENT_PESERTA[];
|
||||
total: number;
|
||||
}) {
|
||||
const router = useRouter()
|
||||
return (
|
||||
<>
|
||||
<Paper withBorder mt={"lg"}>
|
||||
|
||||
@@ -5,10 +5,14 @@ import moment from "moment";
|
||||
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
||||
import { MODEL_EVENT } from "../../model/interface";
|
||||
|
||||
export default function Event_DetailPublish({dataEvent}: {dataEvent: MODEL_EVENT}) {
|
||||
export default function Event_DetailPublish({
|
||||
dataEvent,
|
||||
}: {
|
||||
dataEvent: MODEL_EVENT;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<ComponentEvent_DetailData data={dataEvent}/>
|
||||
<ComponentEvent_DetailData data={dataEvent} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -59,20 +59,20 @@ export default function HomeLayout({
|
||||
<AppShell
|
||||
header={
|
||||
<Header height={50} bg={"dark"}>
|
||||
<Group position="apart" align="center" h={50} p={"sm"}>
|
||||
<Group spacing={"sm"}>
|
||||
<Group position="center" align="center" h={50} p={"sm"}>
|
||||
{/* <Group spacing={"sm"}>
|
||||
<ActionIcon>
|
||||
<IconAward />
|
||||
</ActionIcon>
|
||||
</Group>
|
||||
</Group> */}
|
||||
<Text color="white" fw={"bold"}>
|
||||
HIPMI
|
||||
</Text>
|
||||
<Group spacing={"sm"}>
|
||||
{/* <Group spacing={"sm"}>
|
||||
<ActionIcon>
|
||||
<IconQrcode />
|
||||
</ActionIcon>
|
||||
</Group>
|
||||
</Group> */}
|
||||
</Group>
|
||||
</Header>
|
||||
}
|
||||
|
||||
@@ -61,10 +61,11 @@ export default function HomeView() {
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "Project Collaboration",
|
||||
icon: <IconAffiliate size={50} />,
|
||||
name: "Job Vacancy",
|
||||
icon: <IconBriefcase size={50} />,
|
||||
link: "",
|
||||
},
|
||||
|
||||
{
|
||||
id: 5,
|
||||
name: "Forums",
|
||||
@@ -79,8 +80,8 @@ export default function HomeView() {
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
name: "Job Vacancy",
|
||||
icon: <IconBriefcase size={50} />,
|
||||
name: "Project Collaboration",
|
||||
icon: <IconAffiliate size={50} />,
|
||||
link: "",
|
||||
},
|
||||
{
|
||||
|
||||
142
src/app_modules/vote/component/card_view_publish.tsx
Normal file
142
src/app_modules/vote/component/card_view_publish.tsx
Normal file
@@ -0,0 +1,142 @@
|
||||
"use client";
|
||||
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
|
||||
import {
|
||||
Card,
|
||||
Stack,
|
||||
Grid,
|
||||
Avatar,
|
||||
Divider,
|
||||
Badge,
|
||||
Group,
|
||||
Text,
|
||||
Title,
|
||||
Box,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { MODEL_VOTING } from "../model/interface";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
|
||||
export default function ComponentVote_CardViewPublish({
|
||||
data,
|
||||
path,
|
||||
pilihanSaya,
|
||||
authorName,
|
||||
namaPilihan,
|
||||
}: {
|
||||
data?: MODEL_VOTING;
|
||||
path: string;
|
||||
pilihanSaya?: boolean;
|
||||
authorName?: boolean;
|
||||
namaPilihan?: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30} radius={"md"}>
|
||||
{/* Header name */}
|
||||
{authorName ? (
|
||||
<Card.Section>
|
||||
<ComponentGlobal_AuthorNameOnHeader
|
||||
authorName={data?.Author ? data?.Author.Profile.name : ""}
|
||||
imagesId={data?.Author ? data?.Author.Profile.imagesId : ""}
|
||||
profileId={data?.Author ? data?.Author.Profile.id : ""}
|
||||
/>
|
||||
</Card.Section>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{/* Isi deskripsi */}
|
||||
<Card.Section
|
||||
py={authorName ? "sm" : 0}
|
||||
onClick={() => {
|
||||
if (data?.id === undefined) {
|
||||
ComponentGlobal_NotifikasiPeringatan("Path tidak ditemukan");
|
||||
} else {
|
||||
router.push(path + data?.id);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Stack>
|
||||
<Text fw={"bold"}>{data ? data.title : "Judul Voting"}</Text>
|
||||
<Badge>
|
||||
<Group>
|
||||
<Text>
|
||||
{data
|
||||
? data?.awalVote.toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})
|
||||
: "tgl awal voting"}
|
||||
</Text>
|
||||
<Text>-</Text>
|
||||
<Text>
|
||||
{data
|
||||
? data?.akhirVote.toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})
|
||||
: "tgl akhir voting"}
|
||||
</Text>
|
||||
</Group>
|
||||
</Badge>
|
||||
{data ? (
|
||||
<Stack>
|
||||
<Grid>
|
||||
{data?.Voting_DaftarNamaVote.map((v) => (
|
||||
<Grid.Col key={v.id} span={"auto"}>
|
||||
<Stack align="center" spacing={"xs"}>
|
||||
<Text fz={10} lineClamp={1}>
|
||||
{v.value}
|
||||
</Text>
|
||||
|
||||
<Avatar radius={100} variant="outline" color="blue">
|
||||
<Text>{v.jumlah}</Text>
|
||||
</Avatar>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
))}
|
||||
</Grid>
|
||||
</Stack>
|
||||
) : (
|
||||
<Stack>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Stack align="center" spacing={"xs"}>
|
||||
<Text fz={10}>Voting A</Text>
|
||||
<Avatar radius={100} variant="outline" color="blue">
|
||||
2
|
||||
</Avatar>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Stack align="center" spacing={"xs"}>
|
||||
<Text fz={10}>Voting B</Text>
|
||||
<Avatar radius={100} variant="outline" color="red">
|
||||
3
|
||||
</Avatar>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Stack>
|
||||
)}
|
||||
</Stack>
|
||||
{pilihanSaya ? (
|
||||
<Stack align="center" spacing={0} mt="md">
|
||||
<Text mb={"xs"} fw={"bold"} fz={"xs"}>
|
||||
Pilihan anda:
|
||||
</Text>
|
||||
<Badge size="lg">
|
||||
<Text truncate fz={"xs"}>
|
||||
{namaPilihan}
|
||||
</Text>
|
||||
</Badge>
|
||||
</Stack>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -62,34 +62,6 @@ export default function ComponentVote_CardViewStatus({
|
||||
</Badge>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
{/* <Card.Section py={"sm"}>
|
||||
<Stack>
|
||||
<Radio.Group>
|
||||
<Grid>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Center>
|
||||
<Text>
|
||||
Nama Voting {""}
|
||||
<Text fw={"bold"} inherit span>
|
||||
A
|
||||
</Text>
|
||||
</Text>
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Center>
|
||||
<Text>
|
||||
Nama Voting {""}
|
||||
<Text fw={"bold"} inherit span>
|
||||
B
|
||||
</Text>
|
||||
</Text>
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Radio.Group>
|
||||
</Stack>
|
||||
</Card.Section> */}
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
@@ -0,0 +1,92 @@
|
||||
"use client";
|
||||
import {
|
||||
Card,
|
||||
Stack,
|
||||
Center,
|
||||
Title,
|
||||
Badge,
|
||||
Group,
|
||||
Radio,
|
||||
Grid,
|
||||
Text,
|
||||
Avatar,
|
||||
Divider,
|
||||
Box,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import { MODEL_VOTE_KONTRIBUTOR } from "../../model/interface";
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function ComponentVote_DaftarKontributorVoter({
|
||||
listKontributor,
|
||||
}: {
|
||||
listKontributor?: MODEL_VOTE_KONTRIBUTOR[];
|
||||
}) {
|
||||
const router = useRouter()
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
<Center>
|
||||
<Title order={5}>Daftar Voting</Title>
|
||||
</Center>
|
||||
|
||||
{_.isEmpty(listKontributor) ? (
|
||||
<Center>
|
||||
<Text fz={"xs"} fw={"bold"}>- Tidak ada voting -</Text>
|
||||
</Center>
|
||||
) : (
|
||||
<Stack>
|
||||
{listKontributor?.map((e, i) => (
|
||||
<Stack spacing={"xs"} key={i}>
|
||||
<Grid>
|
||||
<Grid.Col span={2}
|
||||
onClick={() => router.push(RouterProfile.katalog + e.Author.Profile.id)}
|
||||
>
|
||||
<Avatar
|
||||
size={30}
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
e
|
||||
? RouterProfile.api_foto_profile +
|
||||
e.Author.Profile.imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
/>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={5}>
|
||||
<Stack justify="center" h={"100%"}>
|
||||
<Text truncate fz={"sm"} fw={"bold"}>
|
||||
{e ? e.Author.Profile.name : "Nama author"}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={5}>
|
||||
<Badge w={130}>
|
||||
<Text
|
||||
truncate
|
||||
fz={
|
||||
e.Voting_DaftarNamaVote.value.length > 10 ? 8 : 10
|
||||
}
|
||||
>
|
||||
{e.Voting_DaftarNamaVote.value}
|
||||
</Text>
|
||||
</Badge>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Divider />
|
||||
</Stack>
|
||||
))}
|
||||
</Stack>
|
||||
)}
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -12,24 +12,16 @@ import {
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import { IconCircle } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
|
||||
export default function ComponentVote_DetailData({
|
||||
export default function ComponentVote_DetailDataSebelumPublish
|
||||
({
|
||||
data,
|
||||
}: {
|
||||
data?: MODEL_VOTING;
|
||||
}) {
|
||||
const listVote = [
|
||||
{
|
||||
id: 1,
|
||||
value: "A",
|
||||
label: "A",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: "B",
|
||||
label: "B",
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
@@ -65,21 +57,18 @@ export default function ComponentVote_DetailData({
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
<Card.Section py={40}>
|
||||
<Stack>
|
||||
<Radio.Group>
|
||||
<Grid>
|
||||
{data?.Voting_DaftarNamaVote.map((e) => (
|
||||
<Grid.Col key={e.id} span={"auto"}>
|
||||
<Center>
|
||||
<Radio
|
||||
value={e.value}
|
||||
label={<Text fw={"bold"}>{e.value}</Text>}
|
||||
/>
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
))}
|
||||
</Grid>
|
||||
</Radio.Group>
|
||||
<Text fz={10} fw={"bold"}>
|
||||
Pilihan :
|
||||
</Text>
|
||||
<Stack spacing={"xs"}>
|
||||
{data?.Voting_DaftarNamaVote.map((e) => (
|
||||
<Group key={e.id}>
|
||||
<Text>
|
||||
<IconCircle size={10} />
|
||||
</Text>
|
||||
<Text truncate>{e.value}</Text>
|
||||
</Group>
|
||||
))}
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
@@ -0,0 +1,74 @@
|
||||
"use client";
|
||||
import {
|
||||
Card,
|
||||
Stack,
|
||||
Center,
|
||||
Title,
|
||||
Badge,
|
||||
Group,
|
||||
Radio,
|
||||
Grid,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import { IconCircle } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
|
||||
|
||||
export default function ComponentVote_DetailDataSetelahPublish({
|
||||
data,
|
||||
authorName,
|
||||
}: {
|
||||
data?: MODEL_VOTING;
|
||||
authorName?: boolean;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
{authorName ? (
|
||||
<Card.Section>
|
||||
<ComponentGlobal_AuthorNameOnHeader
|
||||
authorName={data?.Author.Profile.name}
|
||||
imagesId={data?.Author.Profile.imagesId}
|
||||
profileId={data?.Author.Profile.id}
|
||||
/>
|
||||
</Card.Section>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
<Card.Section px={"xs"} py={authorName ? "sm" : 0}>
|
||||
<Stack spacing={"lg"}>
|
||||
<Center>
|
||||
<Title order={5}>{data?.title}</Title>
|
||||
</Center>
|
||||
<Text>{data?.deskripsi}</Text>
|
||||
|
||||
<Stack spacing={0} pb={authorName ? 0 : "xs"}>
|
||||
<Center>
|
||||
<Text fz={10} fw={"bold"}>
|
||||
Batas Voting
|
||||
</Text>
|
||||
</Center>
|
||||
<Badge>
|
||||
<Group>
|
||||
<Text>
|
||||
{data?.awalVote.toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
<Text>-</Text>
|
||||
<Text>
|
||||
{data?.akhirVote.toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
</Group>
|
||||
</Badge>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Avatar,
|
||||
Box,
|
||||
Card,
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
List,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { MODEL_VOTING_DAFTAR_NAMA_VOTE } from "../../model/interface";
|
||||
|
||||
export default function ComponentVote_HasilVoting({
|
||||
data,
|
||||
}: {
|
||||
data?: MODEL_VOTING_DAFTAR_NAMA_VOTE[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
<Center>
|
||||
<Title order={5}>Hasil Voting</Title>
|
||||
</Center>
|
||||
|
||||
<Grid justify="center">
|
||||
{data?.map((e) => (
|
||||
<Grid.Col key={e.id} span={data?.length >= 4 ? 6 : 4}>
|
||||
<Stack align="center">
|
||||
<Avatar
|
||||
radius={100}
|
||||
size={70}
|
||||
variant="outline"
|
||||
color="blue"
|
||||
>
|
||||
<Text> {e.jumlah}</Text>
|
||||
</Avatar>
|
||||
<Text fz={"xs"}>{e.value}</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
))}
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
13
src/app_modules/vote/component/is_empty_data.tsx
Normal file
13
src/app_modules/vote/component/is_empty_data.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { Center } from "@mantine/core";
|
||||
|
||||
export default function ComponentVote_IsEmptyData({ text }: { text: string }) {
|
||||
return (
|
||||
<>
|
||||
<Center h={"50vh"} fz={"sm"} fw={"bold"}>
|
||||
{text}
|
||||
</Center>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
Stack,
|
||||
Text,
|
||||
TextInput,
|
||||
Textarea,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { DatePickerInput } from "@mantine/dates";
|
||||
@@ -70,8 +71,11 @@ export default function Vote_Create() {
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<TextInput
|
||||
<Textarea
|
||||
label="Deskripsi"
|
||||
autosize
|
||||
minRows={2}
|
||||
maxRows={5}
|
||||
withAsterisk
|
||||
placeholder="Masukan deskripsi"
|
||||
onChange={(val) => {
|
||||
@@ -1,39 +1,69 @@
|
||||
"use client";
|
||||
|
||||
import { Button, Group, Modal, SimpleGrid, Stack, Title } from "@mantine/core";
|
||||
import ComponentVote_DetailData from "../../component/detail/detail_data";
|
||||
import ComponentVote_DetailDataSebelumPublish from "../../component/detail/detail_data_sebelum_publish";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_vote_status } from "../../global_state";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { Vote_funDeleteById } from "../../fun/delete/fun_delete_by_id";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
|
||||
export default function Vote_DetailDraft() {
|
||||
export default function Vote_DetailDraft({
|
||||
dataVote,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentVote_DetailData />
|
||||
<ButtonAction />
|
||||
<ComponentVote_DetailDataSebelumPublish data={dataVote} />
|
||||
<ButtonAction voteId={dataVote.id} awalVote={dataVote.awalVote} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction() {
|
||||
function ButtonAction({
|
||||
voteId,
|
||||
awalVote,
|
||||
}: {
|
||||
voteId: string;
|
||||
awalVote: Date;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
|
||||
async function onUpdate() {
|
||||
setTabsStatus("Review");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Ajukan Review", 2000);
|
||||
router.back();
|
||||
const hariIni = new Date();
|
||||
if (awalVote < hariIni) return ComponentGlobal_NotifikasiPeringatan("Tanggal Voting Lewat");
|
||||
|
||||
await Vote_funEditStatusByStatusId(voteId, "2").then((res) => {
|
||||
if (res.status === 200) {
|
||||
setTabsStatus("Review");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Ajukan Review", 2000);
|
||||
router.back();
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function onDelete() {
|
||||
setTabsStatus("Draft");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Hapus Vote", 2000);
|
||||
router.back();
|
||||
await Vote_funDeleteById(voteId).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setTabsStatus("Draft");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Hapus Vote", 2000);
|
||||
router.back();
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -8,8 +8,10 @@ import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
|
||||
export default function LayoutVote_DetailDraft({
|
||||
children,
|
||||
voteId
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
voteId: string
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
@@ -18,7 +20,7 @@ export default function LayoutVote_DetailDraft({
|
||||
<ComponentVote_HeaderTamplate
|
||||
title="Detail Draft"
|
||||
icon={<IconEdit />}
|
||||
route2={RouterVote.edit}
|
||||
route2={RouterVote.edit + voteId}
|
||||
/>
|
||||
}
|
||||
>
|
||||
43
src/app_modules/vote/detail/kontribusi/index.tsx
Normal file
43
src/app_modules/vote/detail/kontribusi/index.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Badge,
|
||||
Card,
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
Radio,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
|
||||
import ComponentVote_DaftarKontributorVoter from "../../component/detail/detail_daftar_kontributor";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import ComponentVote_DetailDataSetelahPublish from "../../component/detail/detail_data_setelah_publish";
|
||||
|
||||
export default function Vote_DetailKontribusi({
|
||||
dataVote,
|
||||
listKontributor,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING;
|
||||
listKontributor: any
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentVote_DetailDataSetelahPublish
|
||||
data={dataVote}
|
||||
authorName={true}
|
||||
/>
|
||||
<ComponentVote_HasilVoting data={dataVote.Voting_DaftarNamaVote} />
|
||||
<ComponentVote_DaftarKontributorVoter
|
||||
listKontributor={listKontributor}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
315
src/app_modules/vote/detail/main/index.tsx
Normal file
315
src/app_modules/vote/detail/main/index.tsx
Normal file
@@ -0,0 +1,315 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Card,
|
||||
Stack,
|
||||
Center,
|
||||
Title,
|
||||
Badge,
|
||||
Group,
|
||||
Radio,
|
||||
Grid,
|
||||
Text,
|
||||
Box,
|
||||
Button,
|
||||
Avatar,
|
||||
Divider,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
|
||||
import ComponentVote_DaftarKontributorVoter from "../../component/detail/detail_daftar_kontributor";
|
||||
import {
|
||||
MODEL_VOTE_KONTRIBUTOR,
|
||||
MODEL_VOTING,
|
||||
MODEL_VOTING_DAFTAR_NAMA_VOTE,
|
||||
} from "../../model/interface";
|
||||
import { useState } from "react";
|
||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
|
||||
import _ from "lodash";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
import { Vote_funCreatePilihanVotingById } from "../../fun/create/create_pilihan_voting";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { Vote_funCreateHasil } from "../../fun/create/create_hasil";
|
||||
import { Vote_getOnebyId } from "../../fun/get/get_one_by_id";
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
|
||||
export default function Vote_MainDetail({
|
||||
dataVote,
|
||||
hasilVoting,
|
||||
isKontributor,
|
||||
pilihanKontributor,
|
||||
listKontributor,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING;
|
||||
hasilVoting: any;
|
||||
isKontributor: boolean;
|
||||
pilihanKontributor: string;
|
||||
listKontributor: any[];
|
||||
}) {
|
||||
const [data, setData] = useState(dataVote);
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<TampilanDataVoting
|
||||
dataVote={data}
|
||||
setData={setData}
|
||||
isKontributor={isKontributor}
|
||||
pilihanKontributor={pilihanKontributor}
|
||||
/>
|
||||
<ComponentVote_HasilVoting data={data.Voting_DaftarNamaVote} />
|
||||
<ComponentVote_DaftarKontributorVoter
|
||||
listKontributor={listKontributor}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TampilanDataVoting({
|
||||
dataVote,
|
||||
setData,
|
||||
isKontributor,
|
||||
pilihanKontributor,
|
||||
}: {
|
||||
dataVote?: MODEL_VOTING;
|
||||
setData: any;
|
||||
isKontributor: boolean;
|
||||
pilihanKontributor: any;
|
||||
}) {
|
||||
const [votingNameId, setVotingNameId] = useState("");
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
<Card.Section>
|
||||
<ComponentGlobal_AuthorNameOnHeader
|
||||
authorName={dataVote?.Author.Profile.name}
|
||||
imagesId={dataVote?.Author.Profile.imagesId}
|
||||
profileId={dataVote?.Author.Profile.id}
|
||||
/>
|
||||
</Card.Section>
|
||||
<Card.Section px={"xs"} py={"sm"}>
|
||||
<Stack spacing={"lg"}>
|
||||
<Center>
|
||||
<Title order={5}>{dataVote?.title}</Title>
|
||||
</Center>
|
||||
<Text>{dataVote?.deskripsi}</Text>
|
||||
|
||||
<Stack spacing={0}>
|
||||
<Center>
|
||||
<Text fz={10} fw={"bold"}>
|
||||
Batas Voting
|
||||
</Text>
|
||||
</Center>
|
||||
<Badge>
|
||||
<Group>
|
||||
<Text>
|
||||
{dataVote?.awalVote.toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
<Text>-</Text>
|
||||
<Text>
|
||||
{dataVote?.akhirVote.toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
</Group>
|
||||
</Badge>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
|
||||
{/* Voting View */}
|
||||
<Card.Section py={"xl"}>
|
||||
{isKontributor ? (
|
||||
<Stack align="center" spacing={0}>
|
||||
<Text mb={"sm"} fw={"bold"} fz={"xs"}>
|
||||
Pilihan anda:
|
||||
</Text>
|
||||
<Badge size="lg">
|
||||
{pilihanKontributor.Voting_DaftarNamaVote.value}
|
||||
</Badge>
|
||||
</Stack>
|
||||
) : (
|
||||
<Stack spacing={"xl"}>
|
||||
<Radio.Group
|
||||
value={votingNameId}
|
||||
onChange={(val) => {
|
||||
setVotingNameId(val);
|
||||
}}
|
||||
label={
|
||||
<Text mb={"sm"} fw={"bold"} fz={"xs"}>
|
||||
Pilihan :
|
||||
</Text>
|
||||
}
|
||||
>
|
||||
<Stack px={"md"}>
|
||||
{dataVote?.Voting_DaftarNamaVote.map((v) => (
|
||||
<Box key={v.id}>
|
||||
<Radio label={v.value} value={v.id} />
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</Radio.Group>
|
||||
<Center>
|
||||
{_.isEmpty(votingNameId) ? (
|
||||
<Button radius={"xl"} disabled>
|
||||
Vote
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
radius={"xl"}
|
||||
onClick={() =>
|
||||
onVote(votingNameId, dataVote?.id as any, setData)
|
||||
}
|
||||
>
|
||||
Vote
|
||||
</Button>
|
||||
)}
|
||||
</Center>
|
||||
</Stack>
|
||||
)}
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
async function onVote(pilihanVotingId: string, voteId: string, setData: any) {
|
||||
await Vote_funCreateHasil(pilihanVotingId, voteId).then(async (res) => {
|
||||
if (res.status === 201) {
|
||||
await Vote_getOnebyId(voteId).then((val) => {
|
||||
setData(val);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function TampilanHasil({
|
||||
data,
|
||||
hasil,
|
||||
}: {
|
||||
data: MODEL_VOTING_DAFTAR_NAMA_VOTE[];
|
||||
hasil: any;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
<Center>
|
||||
<Title order={5}>Hasil Voting</Title>
|
||||
</Center>
|
||||
|
||||
{/* <pre>{JSON.stringify(data, null,2)}</pre> */}
|
||||
|
||||
<Grid justify="center">
|
||||
{data.map((e) => (
|
||||
<Grid.Col key={e.id} span={data.length >= 4 ? 6 : 4}>
|
||||
<Stack align="center">
|
||||
<Avatar
|
||||
radius={100}
|
||||
size={70}
|
||||
variant="outline"
|
||||
color="blue"
|
||||
>
|
||||
<Text>
|
||||
{e.jumlah}
|
||||
{/* {hasil.filter((i: any) => i.idDaftarNama == "clsijw6ur0002x5loqsq6g4id")} */}
|
||||
</Text>
|
||||
</Avatar>
|
||||
<Text>{e.value}</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
))}
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TampilanListKontributor({
|
||||
lisKontributor,
|
||||
}: {
|
||||
lisKontributor: MODEL_VOTE_KONTRIBUTOR[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
<Center>
|
||||
<Title order={5}>Daftar Voting</Title>
|
||||
</Center>
|
||||
{lisKontributor.map((e, i) => (
|
||||
<Stack spacing={"xs"} key={i}>
|
||||
<Grid>
|
||||
<Grid.Col span={2}>
|
||||
<Avatar
|
||||
size={30}
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
e
|
||||
? RouterProfile.api_foto_profile +
|
||||
e.Author.Profile.imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
/>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Stack justify="center" h={"100%"}>
|
||||
<Text truncate fz={"sm"} fw={"bold"}>
|
||||
{e ? e.Author.Profile.name : "Nama author"}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={4}>
|
||||
<Badge w={100}>
|
||||
<Text truncate>{e.Voting_DaftarNamaVote.value}</Text>
|
||||
</Badge>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Divider />
|
||||
</Stack>
|
||||
))}
|
||||
{/* {lisKontributor.map((e) => (
|
||||
<Stack key={e.id}>
|
||||
<Group position="apart">
|
||||
<Group>
|
||||
<Avatar
|
||||
size={30}
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
e
|
||||
? RouterProfile.api_foto_profile +
|
||||
e.Author.Profile.imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
/>
|
||||
<Text truncate fz={"sm"} fw={"bold"}>
|
||||
{e ? e.Author.Profile.name : "Nama author"}
|
||||
</Text>
|
||||
</Group>
|
||||
<Badge>
|
||||
<Text truncate>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Harum minus libero, ullam ipsum quasi labore iure doloremque sunt et mollitia dolorem laborum quisquam, dolores quis deserunt id. Ipsa, minus temporibus.</Text>
|
||||
</Badge>
|
||||
</Group>
|
||||
<Divider />
|
||||
</Stack>
|
||||
))} */}
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
{/* <pre>{JSON.stringify(lisKontributor, null, 2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
81
src/app_modules/vote/detail/publish/index.tsx
Normal file
81
src/app_modules/vote/detail/publish/index.tsx
Normal file
@@ -0,0 +1,81 @@
|
||||
"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 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";
|
||||
|
||||
export default function Vote_DetailPublish({
|
||||
dataVote,
|
||||
listKontributor,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING;
|
||||
listKontributor: MODEL_VOTE_KONTRIBUTOR;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{/* <ComponentVote_DetailStatus /> */}
|
||||
<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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -9,39 +9,59 @@ import {
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import ComponentVote_DetailData from "../../component/detail/detail_data";
|
||||
import ComponentVote_DetailDataSebelumPublish from "../../component/detail/detail_data_sebelum_publish";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_vote_status } from "../../global_state";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import { Vote_funDeleteById } from "../../fun/delete/fun_delete_by_id";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
|
||||
|
||||
export default function Vote_DetailReject() {
|
||||
export default function Vote_DetailReject({
|
||||
dataVote,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={"xl"}>
|
||||
<ComponentVote_DetailData />
|
||||
<ButtonAction />
|
||||
<ComponentVote_DetailDataSebelumPublish data={dataVote as any} />
|
||||
<ButtonAction voteId={dataVote.id} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction() {
|
||||
function ButtonAction({ voteId }: { voteId: string }) {
|
||||
const router = useRouter();
|
||||
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
|
||||
async function onUpdate() {
|
||||
setTabsStatus("Draft");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Masuk Draft", 2000);
|
||||
router.back();
|
||||
await Vote_funEditStatusByStatusId(voteId, "3").then((res) => {
|
||||
if (res.status === 200) {
|
||||
setTabsStatus("Draft");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Masuk Draft", 2000);
|
||||
router.back();
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function onDelete() {
|
||||
setTabsStatus("Reject");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Hapus Vote", 2000);
|
||||
router.back();
|
||||
await Vote_funDeleteById(voteId).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setTabsStatus("Draft");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Hapus Vote", 2000);
|
||||
router.back();
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
69
src/app_modules/vote/detail/review/index.tsx
Normal file
69
src/app_modules/vote/detail/review/index.tsx
Normal file
@@ -0,0 +1,69 @@
|
||||
"use client";
|
||||
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
Card,
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
Radio,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
import moment from "moment";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { gs_vote_status } from "../../global_state";
|
||||
import ComponentVote_DetailDataSebelumPublish from "../../component/detail/detail_data_sebelum_publish";
|
||||
import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
|
||||
export default function Vote_DetailReview({
|
||||
dataVote,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={"xl"}>
|
||||
<ComponentVote_DetailDataSebelumPublish data={dataVote as any} />
|
||||
<ButtonAction voteId={dataVote.id} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction({ voteId }: { voteId: string }) {
|
||||
const router = useRouter();
|
||||
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
|
||||
|
||||
async function onUpdate() {
|
||||
await Vote_funEditStatusByStatusId(voteId, "3").then((res) => {
|
||||
if (res.status === 200) {
|
||||
setTabsStatus("Draft");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Batalkan Review", 2000);
|
||||
router.back();
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="red"
|
||||
onClick={() => {
|
||||
onUpdate();
|
||||
}}
|
||||
>
|
||||
Batalkan Review
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
30
src/app_modules/vote/detail/riwayat_saya/page.tsx
Normal file
30
src/app_modules/vote/detail/riwayat_saya/page.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
"use client";
|
||||
|
||||
import { Stack } from "@mantine/core";
|
||||
import ComponentVote_DaftarKontributorVoter from "../../component/detail/detail_daftar_kontributor";
|
||||
import ComponentVote_DetailDataSetelahPublish from "../../component/detail/detail_data_setelah_publish";
|
||||
import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
|
||||
export default function Vote_DetailRiwayatSaya({
|
||||
dataVote,
|
||||
listKontributor,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING;
|
||||
listKontributor: any[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentVote_DetailDataSetelahPublish
|
||||
data={dataVote}
|
||||
authorName={true}
|
||||
/>
|
||||
<ComponentVote_HasilVoting data={dataVote.Voting_DaftarNamaVote} />
|
||||
<ComponentVote_DaftarKontributorVoter
|
||||
listKontributor={listKontributor}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
29
src/app_modules/vote/detail/semua_riwayat/page.tsx
Normal file
29
src/app_modules/vote/detail/semua_riwayat/page.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
"use client";
|
||||
|
||||
import { Stack } from "@mantine/core";
|
||||
import ComponentVote_DetailDataTanpaVote from "../../component/detail/detail_data_tanpa_vote";
|
||||
import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
|
||||
import ComponentVote_DaftarKontributorVoter from "../../component/detail/detail_daftar_kontributor";
|
||||
import ComponentVote_DetailDataSetelahPublish from "../../component/detail/detail_data_setelah_publish";
|
||||
import { MODEL_VOTE_KONTRIBUTOR, MODEL_VOTING } from "../../model/interface";
|
||||
|
||||
export default function Vote_DetailSemuaRiwayat({
|
||||
dataVote,
|
||||
listKontributor,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING;
|
||||
listKontributor:MODEL_VOTE_KONTRIBUTOR[]
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentVote_DetailDataSetelahPublish
|
||||
data={dataVote}
|
||||
authorName={true}
|
||||
/>
|
||||
<ComponentVote_HasilVoting data={dataVote.Voting_DaftarNamaVote} />
|
||||
<ComponentVote_DaftarKontributorVoter listKontributor={listKontributor} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
162
src/app_modules/vote/edit/index.tsx
Normal file
162
src/app_modules/vote/edit/index.tsx
Normal file
@@ -0,0 +1,162 @@
|
||||
"use client";
|
||||
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
Stack,
|
||||
Text,
|
||||
TextInput,
|
||||
Textarea,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { DatePickerInput } from "@mantine/dates";
|
||||
import { useCounter } from "@mantine/hooks";
|
||||
import { IconHome, IconPlus } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import moment from "moment";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { gs_vote_hotMenu, gs_vote_status } from "../global_state";
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import {
|
||||
MODEL_VOTING,
|
||||
MODEL_VOTING_DAFTAR_NAMA_VOTE,
|
||||
} from "../model/interface";
|
||||
import _ from "lodash";
|
||||
import { Vote_funEditById } from "../fun/edit/fun_edit_by_id";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
|
||||
export default function Vote_Edit({
|
||||
dataVote,
|
||||
listDaftarVote,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING;
|
||||
listDaftarVote: MODEL_VOTING_DAFTAR_NAMA_VOTE[];
|
||||
}) {
|
||||
const [data, setData] = useState(dataVote);
|
||||
const [listVoting, setListVoting] = useState(listDaftarVote);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack px={"sm"}>
|
||||
<TextInput
|
||||
label="Judul"
|
||||
withAsterisk
|
||||
placeholder="Masukan judul"
|
||||
value={data.title}
|
||||
onChange={(val) => {
|
||||
setData({
|
||||
...data,
|
||||
title: val.target.value,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<Textarea
|
||||
label="Deskripsi"
|
||||
autosize
|
||||
minRows={2}
|
||||
maxRows={5}
|
||||
withAsterisk
|
||||
placeholder="Masukan deskripsi"
|
||||
value={data.deskripsi}
|
||||
onChange={(val) => {
|
||||
setData({
|
||||
...data,
|
||||
deskripsi: val.target.value,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
<DatePickerInput
|
||||
label="Jangka Waktu"
|
||||
placeholder="Masukan jangka waktu voting"
|
||||
withAsterisk
|
||||
dropdownType="modal"
|
||||
type="range"
|
||||
excludeDate={(date) => {
|
||||
return moment(date).diff(Date.now(), "days") < 0;
|
||||
}}
|
||||
value={[data.awalVote, data.akhirVote]}
|
||||
onChange={(val: any) =>
|
||||
setData({
|
||||
...data,
|
||||
awalVote: val[0],
|
||||
akhirVote: val[1],
|
||||
})
|
||||
}
|
||||
/>
|
||||
|
||||
<Stack spacing={0}>
|
||||
<Center>
|
||||
<Text fw={"bold"} fz={"sm"}>
|
||||
Daftar Voting
|
||||
</Text>
|
||||
</Center>
|
||||
|
||||
<Stack>
|
||||
<Stack>
|
||||
{listVoting.map((e, index) => (
|
||||
<Box key={index}>
|
||||
<TextInput
|
||||
label={"Nama Voting"}
|
||||
withAsterisk
|
||||
placeholder="Nama pilihan voting"
|
||||
value={e.value}
|
||||
onChange={(v) => {
|
||||
const cloneData = _.clone(listVoting);
|
||||
cloneData[index].value = v.currentTarget.value;
|
||||
|
||||
setListVoting([...listVoting]);
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
<ButtonAction data={data} listVoting={listVoting} />
|
||||
|
||||
{/* <pre>{JSON.stringify(listDaftarVote, null, 2)}</pre> */}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction({
|
||||
data,
|
||||
listVoting,
|
||||
}: {
|
||||
data: MODEL_VOTING;
|
||||
listVoting: MODEL_VOTING_DAFTAR_NAMA_VOTE[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_vote_hotMenu);
|
||||
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
|
||||
|
||||
async function onUpdate() {
|
||||
await Vote_funEditById(data, listVoting).then((res) => {
|
||||
if (res.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Update");
|
||||
// setHotMenu(1);
|
||||
// setTabsStatus("Draft");
|
||||
router.back();
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button mt={"lg"} radius={"xl"} color="green" onClick={() => onUpdate()}>
|
||||
Update
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
46
src/app_modules/vote/fun/create/create_hasil.ts
Normal file
46
src/app_modules/vote/fun/create/create_hasil.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } 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_getUserId();
|
||||
|
||||
const get = await prisma.voting_DaftarNamaVote.findFirst({
|
||||
where: {
|
||||
id: pilihanVotingId,
|
||||
},
|
||||
select: {
|
||||
jumlah: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!get) return { status: 400, message: "Gagal Voting" };
|
||||
|
||||
const updt = await prisma.voting_DaftarNamaVote.update({
|
||||
where: {
|
||||
id: pilihanVotingId,
|
||||
},
|
||||
data: {
|
||||
jumlah: get.jumlah + 1,
|
||||
},
|
||||
});
|
||||
if (!updt) return { status: 400, message: "Gagal Update" };
|
||||
|
||||
const create = await prisma.voting_Kontributor.create({
|
||||
data: {
|
||||
voting_DaftarNamaVoteId: pilihanVotingId,
|
||||
votingId: votingId,
|
||||
authorId: authorId,
|
||||
},
|
||||
});
|
||||
if (!create) return { status: 400, message: "Gagal Menjadi Kontributor" };
|
||||
|
||||
|
||||
revalidatePath("/dev/vote/detail/main/");
|
||||
return { status: 201, message: "Berhasil Voting" };
|
||||
}
|
||||
24
src/app_modules/vote/fun/create/create_pilihan_voting.ts
Normal file
24
src/app_modules/vote/fun/create/create_pilihan_voting.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } 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_getUserId();
|
||||
|
||||
const create = await prisma.voting_Kontributor.create({
|
||||
data: {
|
||||
voting_DaftarNamaVoteId: namaVotingId,
|
||||
votingId: votingId,
|
||||
authorId: authorId,
|
||||
},
|
||||
});
|
||||
|
||||
if(!create) return {status: 400, message: "Gagal Voting"}
|
||||
revalidatePath("/dev/vote/detail/main/");
|
||||
return {status: 201, message: "Berhasil Voting"}
|
||||
}
|
||||
26
src/app_modules/vote/fun/delete/fun_delete_by_id.ts
Normal file
26
src/app_modules/vote/fun/delete/fun_delete_by_id.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
/**
|
||||
* @param voteId
|
||||
* @returns isActive berubah menjadi false
|
||||
*/
|
||||
export async function Vote_funDeleteById(voteId: string) {
|
||||
const del = await prisma.voting.update({
|
||||
where: {
|
||||
id: voteId,
|
||||
},
|
||||
data: {
|
||||
isActive: false,
|
||||
},
|
||||
});
|
||||
|
||||
if (!del) return { status: 400, message: "Gagal Hapus Data" };
|
||||
revalidatePath("/dev/vote/main/status");
|
||||
return {
|
||||
status: 200,
|
||||
message: "Hapus Berhasil",
|
||||
};
|
||||
}
|
||||
48
src/app_modules/vote/fun/edit/fun_edit_by_id.ts
Normal file
48
src/app_modules/vote/fun/edit/fun_edit_by_id.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import {
|
||||
MODEL_VOTING,
|
||||
MODEL_VOTING_DAFTAR_NAMA_VOTE,
|
||||
} from "../../model/interface";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function Vote_funEditById(
|
||||
data: MODEL_VOTING,
|
||||
listVoting: MODEL_VOTING_DAFTAR_NAMA_VOTE[]
|
||||
) {
|
||||
// console.log(listVoting)
|
||||
const updtVoting = await prisma.voting.update({
|
||||
where: {
|
||||
id: data.id,
|
||||
},
|
||||
data: {
|
||||
title: data.title,
|
||||
deskripsi: data.deskripsi,
|
||||
awalVote: data.awalVote,
|
||||
akhirVote: data.akhirVote,
|
||||
},
|
||||
});
|
||||
|
||||
if (!updtVoting) return { status: 400, message: "Gagal Update" };
|
||||
|
||||
for (let e of listVoting) {
|
||||
const updtListVoting = await prisma.voting_DaftarNamaVote.updateMany({
|
||||
where: {
|
||||
id: e.id,
|
||||
},
|
||||
data: {
|
||||
value: e.value,
|
||||
},
|
||||
});
|
||||
|
||||
if (!updtListVoting)
|
||||
return { status: 400, message: "Gagal Update Daftar Vote" };
|
||||
}
|
||||
|
||||
revalidatePath("/dev/vote/detail/draft");
|
||||
return {
|
||||
status: 200,
|
||||
message: "Berhasil Update",
|
||||
};
|
||||
}
|
||||
26
src/app_modules/vote/fun/edit/fun_edit_status_by_id.ts
Normal file
26
src/app_modules/vote/fun/edit/fun_edit_status_by_id.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function Vote_funEditStatusByStatusId(
|
||||
voteId: string,
|
||||
statusId: string
|
||||
) {
|
||||
const updt = await prisma.voting.update({
|
||||
where: {
|
||||
id: voteId,
|
||||
},
|
||||
data: {
|
||||
voting_StatusId: statusId,
|
||||
},
|
||||
});
|
||||
|
||||
if (!updt) return { status: 400, message: "Gagal Update" };
|
||||
revalidatePath("/dev/vote/main/status");
|
||||
return {
|
||||
status: 200,
|
||||
message: "Update Berhasil",
|
||||
};
|
||||
}
|
||||
21
src/app_modules/vote/fun/get/cek_kontributor_by_id.ts
Normal file
21
src/app_modules/vote/fun/get/cek_kontributor_by_id.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Vote_cekKontributorById(votingId: string) {
|
||||
const UserId = await User_getUserId()
|
||||
|
||||
const cek = await prisma.voting_Kontributor.count({
|
||||
where: {
|
||||
authorId: UserId,
|
||||
votingId: votingId,
|
||||
},
|
||||
});
|
||||
|
||||
if (cek > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
47
src/app_modules/vote/fun/get/get_all_list_publish.ts
Normal file
47
src/app_modules/vote/fun/get/get_all_list_publish.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Vote_getAllListPublish() {
|
||||
const data = await prisma.voting.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
voting_StatusId: "1",
|
||||
isActive: true,
|
||||
akhirVote: {
|
||||
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,
|
||||
Voting_DaftarNamaVote: {
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
},
|
||||
},
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
nomor: true,
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
46
src/app_modules/vote/fun/get/get_all_list_riwayat.ts
Normal file
46
src/app_modules/vote/fun/get/get_all_list_riwayat.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
"use server"
|
||||
|
||||
import prisma from "@/app/lib/prisma"
|
||||
|
||||
export async function Vote_getAllListRiwayat() {
|
||||
const data = await prisma.voting.findMany({
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
},
|
||||
where: {
|
||||
voting_StatusId: "1",
|
||||
isActive: true,
|
||||
akhirVote: {
|
||||
lte: 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,
|
||||
Voting_DaftarNamaVote: {
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
},
|
||||
},
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
nomor: true,
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return data
|
||||
}
|
||||
49
src/app_modules/vote/fun/get/get_all_list_riwayat_saya.ts
Normal file
49
src/app_modules/vote/fun/get/get_all_list_riwayat_saya.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
"use server";
|
||||
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function Vote_getAllListRiwayatSaya() {
|
||||
const authorId = await User_getUserId();
|
||||
const data = await prisma.voting.findMany({
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
},
|
||||
where: {
|
||||
voting_StatusId: "1",
|
||||
authorId: authorId,
|
||||
isActive: true,
|
||||
akhirVote: {
|
||||
lte: 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,
|
||||
Voting_DaftarNamaVote: {
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
},
|
||||
},
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
nomor: true,
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
13
src/app_modules/vote/fun/get/get_list_daftar_vote_by_id.ts
Normal file
13
src/app_modules/vote/fun/get/get_list_daftar_vote_by_id.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function Vote_getListDaftarNamaById(voteId: string) {
|
||||
const data = await prisma.voting_DaftarNamaVote.findMany({
|
||||
where: {
|
||||
votingId: voteId,
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
42
src/app_modules/vote/fun/get/get_list_hasil_by_id.ts
Normal file
42
src/app_modules/vote/fun/get/get_list_hasil_by_id.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { MODEL_VOTING_DAFTAR_NAMA_VOTE } from "../../model/interface";
|
||||
import _ from "lodash";
|
||||
|
||||
export async function Vote_getHasilVoteById(
|
||||
daftarPilihanVoting: MODEL_VOTING_DAFTAR_NAMA_VOTE[]
|
||||
) {
|
||||
// console.log(daftarPilihanVoting)
|
||||
|
||||
// for (let e of daftarPilihanVoting) {
|
||||
// const get = await prisma.voting_Kontributor.count({
|
||||
// where: {
|
||||
// voting_DaftarNamaVoteId: e.id,
|
||||
// },
|
||||
// });
|
||||
|
||||
// console.log(get);
|
||||
// return get
|
||||
// }
|
||||
|
||||
const data = await prisma.voting_Kontributor.findMany({
|
||||
where: {
|
||||
votingId: "clsijw6uf0001x5logh7msuh1",
|
||||
},
|
||||
});
|
||||
|
||||
const hitung = _.map(
|
||||
_.groupBy(data, "voting_DaftarNamaVoteId"),
|
||||
(v: any) => ({
|
||||
jumlah: v.length,
|
||||
idDaftarNama: v[0].voting_DaftarNamaVoteId,
|
||||
})
|
||||
);
|
||||
|
||||
// const filter = hitung.filter(
|
||||
// (i: any) => i.idDaftarNama == "clsijw6ur0002x5loqsq6g4id"
|
||||
// );
|
||||
|
||||
return hitung
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Vote_getAllListKontribusiByAuthorId() {
|
||||
const authorId = await User_getUserId();
|
||||
const data = await prisma.voting_Kontributor.findMany({
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
},
|
||||
where: {
|
||||
authorId: authorId,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
Voting: {
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
awalVote: true,
|
||||
akhirVote: true,
|
||||
Voting_DaftarNamaVote: {
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
},
|
||||
},
|
||||
Author: {
|
||||
select: {
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Voting_DaftarNamaVote: true,
|
||||
Author: true,
|
||||
},
|
||||
});
|
||||
return data;
|
||||
}
|
||||
26
src/app_modules/vote/fun/get/get_list_kontributor_by_id.ts
Normal file
26
src/app_modules/vote/fun/get/get_list_kontributor_by_id.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function Vote_getListKontributorById(votingId: string) {
|
||||
const data = await prisma.voting_Kontributor.findMany({
|
||||
where: {
|
||||
votingId: votingId,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
Author: {
|
||||
select: {
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
Voting_DaftarNamaVote: {
|
||||
select: {
|
||||
value: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -8,9 +8,34 @@ export async function Vote_getListByStatusId(statusId: string) {
|
||||
|
||||
if (statusId === "1") {
|
||||
const data = await prisma.voting.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
voting_StatusId: "1",
|
||||
authorId: authorId,
|
||||
isActive: true,
|
||||
akhirVote: {
|
||||
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,
|
||||
Voting_DaftarNamaVote: {
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -19,9 +44,13 @@ export async function Vote_getListByStatusId(statusId: string) {
|
||||
|
||||
if (statusId === "2") {
|
||||
const data = await prisma.voting.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
voting_StatusId: "2",
|
||||
authorId: authorId,
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -30,9 +59,13 @@ export async function Vote_getListByStatusId(statusId: string) {
|
||||
|
||||
if (statusId === "3") {
|
||||
const data = await prisma.voting.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
voting_StatusId: "3",
|
||||
authorId: authorId,
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -41,9 +74,13 @@ export async function Vote_getListByStatusId(statusId: string) {
|
||||
|
||||
if (statusId === "4") {
|
||||
const data = await prisma.voting.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
voting_StatusId: "4",
|
||||
authorId: authorId,
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -19,7 +19,17 @@ export async function Vote_getOnebyId(voteId: string) {
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
voting_StatusId: true,
|
||||
Voting_DaftarNamaVote: true,
|
||||
Voting_DaftarNamaVote: {
|
||||
orderBy: {
|
||||
createdAt: "asc"
|
||||
}
|
||||
},
|
||||
Author: {
|
||||
select: {
|
||||
Profile: true
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
});
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Vote_getOnePilihanVotingByUserId(votingId: string) {
|
||||
const userId = await User_getUserId();
|
||||
const get = await prisma.voting_Kontributor.findFirst({
|
||||
where: {
|
||||
authorId: userId,
|
||||
votingId: votingId,
|
||||
},
|
||||
select: {
|
||||
Voting_DaftarNamaVote: {
|
||||
select: {
|
||||
value: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return get;
|
||||
}
|
||||
36
src/app_modules/vote/fun/get/get_one_publish_by_id.ts
Normal file
36
src/app_modules/vote/fun/get/get_one_publish_by_id.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function Vote_getOnePublishbyId(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,
|
||||
Voting_DaftarNamaVote: {
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
},
|
||||
},
|
||||
Author: {
|
||||
select: {
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -23,8 +23,14 @@ import { IconCirclePlus } from "@tabler/icons-react";
|
||||
import moment from "moment";
|
||||
import { useRouter } from "next/navigation";
|
||||
import ComponentVote_CardViewPublish from "../component/card_view_publish";
|
||||
import { MODEL_VOTING } from "../model/interface";
|
||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
|
||||
|
||||
export default function Vote_Beranda() {
|
||||
export default function Vote_Beranda({
|
||||
dataVote,
|
||||
}: {
|
||||
dataVote: MODEL_VOTING[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
@@ -44,13 +50,15 @@ export default function Vote_Beranda() {
|
||||
</Affix>
|
||||
|
||||
<Stack>
|
||||
{Array(5)
|
||||
.fill(0)
|
||||
.map((e, i) => (
|
||||
<Box key={i}>
|
||||
<ComponentVote_CardViewPublish path={RouterVote.main_detail}/>
|
||||
</Box>
|
||||
))}
|
||||
{dataVote.map((e, i) => (
|
||||
<Box key={i}>
|
||||
<ComponentVote_CardViewPublish
|
||||
path={RouterVote.main_detail}
|
||||
data={e}
|
||||
authorName={true}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
47
src/app_modules/vote/main/kontribusi.tsx
Normal file
47
src/app_modules/vote/main/kontribusi.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
"use client";
|
||||
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Box,
|
||||
Card,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Radio,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import { useRouter } from "next/navigation";
|
||||
import ComponentVote_CardViewPublish from "../component/card_view_publish";
|
||||
import { MODEL_VOTE_KONTRIBUTOR } from "../model/interface";
|
||||
|
||||
export default function Vote_Kontribusi({
|
||||
dataKontribusi,
|
||||
}: {
|
||||
dataKontribusi: MODEL_VOTE_KONTRIBUTOR[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{dataKontribusi.map((e, i) => (
|
||||
<Box key={i}>
|
||||
<ComponentVote_CardViewPublish
|
||||
path={RouterVote.detail_kontribusi}
|
||||
pilihanSaya={true}
|
||||
data={e.Voting}
|
||||
authorName={true}
|
||||
namaPilihan={e.Voting_DaftarNamaVote.value}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
{/* <pre>{JSON.stringify(dataKontribusi, null, 2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -6,19 +6,26 @@ import Vote_SemuaRiwayat from "./semua";
|
||||
import Vote_RiwayatSaya from "./saya";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_vote_riwayat } from "../../global_state";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
|
||||
export default function Vote_Riwayat() {
|
||||
const [tabsRiwayat, setTabsRiwayat] = useAtom(gs_vote_riwayat)
|
||||
export default function Vote_Riwayat({
|
||||
listRiwayat,
|
||||
listRiwayatSaya,
|
||||
}: {
|
||||
listRiwayat: MODEL_VOTING[];
|
||||
listRiwayatSaya: MODEL_VOTING[]
|
||||
}) {
|
||||
const [tabsRiwayat, setTabsRiwayat] = useAtom(gs_vote_riwayat);
|
||||
const listTabs = [
|
||||
{
|
||||
id: 1,
|
||||
path: <Vote_SemuaRiwayat />,
|
||||
path: <Vote_SemuaRiwayat listRiwayat={listRiwayat} />,
|
||||
value: "Semua",
|
||||
label: "Semua Riwayat",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
path: <Vote_RiwayatSaya />,
|
||||
path: <Vote_RiwayatSaya listRiwayatSaya={listRiwayatSaya} />,
|
||||
value: "Saya",
|
||||
label: "Riwayat Saya",
|
||||
},
|
||||
@@ -18,21 +18,26 @@ import {
|
||||
import moment from "moment";
|
||||
import { useRouter } from "next/navigation";
|
||||
import ComponentVote_CardViewPublish from "../../component/card_view_publish";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
|
||||
export default function Vote_RiwayatSaya() {
|
||||
export default function Vote_RiwayatSaya({
|
||||
listRiwayatSaya,
|
||||
}: {
|
||||
listRiwayatSaya: MODEL_VOTING[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{Array(5)
|
||||
.fill(0)
|
||||
.map((e, i) => (
|
||||
<Box key={i}>
|
||||
<ComponentVote_CardViewPublish
|
||||
path={RouterVote.detail_riwayat_saya}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
{listRiwayatSaya.map((e, i) => (
|
||||
<Box key={i}>
|
||||
<ComponentVote_CardViewPublish
|
||||
path={RouterVote.detail_riwayat_saya}
|
||||
data={e}
|
||||
authorName={true}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
@@ -18,21 +18,26 @@ import {
|
||||
import moment from "moment";
|
||||
import { useRouter } from "next/navigation";
|
||||
import ComponentVote_CardViewPublish from "../../component/card_view_publish";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
|
||||
export default function Vote_SemuaRiwayat() {
|
||||
export default function Vote_SemuaRiwayat({
|
||||
listRiwayat,
|
||||
}: {
|
||||
listRiwayat: MODEL_VOTING[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{Array(5)
|
||||
.fill(0)
|
||||
.map((e, i) => (
|
||||
<Box key={i}>
|
||||
<ComponentVote_CardViewPublish
|
||||
path={RouterVote.detail_semua_riwayat}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
{listRiwayat.map((e, i) => (
|
||||
<Box key={i}>
|
||||
<ComponentVote_CardViewPublish
|
||||
path={RouterVote.detail_semua_riwayat}
|
||||
data={e}
|
||||
authorName={true}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
31
src/app_modules/vote/main/status/draft.tsx
Normal file
31
src/app_modules/vote/main/status/draft.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
"use client";
|
||||
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import ComponentVote_CardViewStatus from "../../component/card_view_status";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import _ from "lodash";
|
||||
import { Box, Center, Stack, Text } from "@mantine/core";
|
||||
import ComponentVote_IsEmptyData from "../../component/is_empty_data";
|
||||
|
||||
export default function Vote_StatusDraft({
|
||||
listDraft,
|
||||
}: {
|
||||
listDraft: MODEL_VOTING[];
|
||||
}) {
|
||||
if (_.isEmpty(listDraft))
|
||||
return <ComponentVote_IsEmptyData text="Tidak ada draft" />;
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{listDraft.map((e) => (
|
||||
<Box key={e.id}>
|
||||
<ComponentVote_CardViewStatus
|
||||
path={RouterVote.detail_draft}
|
||||
data={e}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -26,7 +26,7 @@ export default function Vote_Status({
|
||||
const listTabs = [
|
||||
{
|
||||
id: 1,
|
||||
path: <Vote_StatusPublish />,
|
||||
path: <Vote_StatusPublish listPublish={listPublish} />,
|
||||
value: "Publish",
|
||||
},
|
||||
{
|
||||
@@ -36,12 +36,12 @@ export default function Vote_Status({
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
path: <Vote_StatusDraft />,
|
||||
path: <Vote_StatusDraft listDraft={listDraft} />,
|
||||
value: "Draft",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
path: <Vote_StatusReject />,
|
||||
path: <Vote_StatusReject listReject={listReject} />,
|
||||
value: "Reject",
|
||||
},
|
||||
];
|
||||
54
src/app_modules/vote/main/status/publish.tsx
Normal file
54
src/app_modules/vote/main/status/publish.tsx
Normal file
@@ -0,0 +1,54 @@
|
||||
"use client";
|
||||
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Box,
|
||||
Card,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Radio,
|
||||
Skeleton,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import ComponentVote_IsEmptyData from "../../component/is_empty_data";
|
||||
import _ from "lodash";
|
||||
import ComponentVote_CardViewPublish from "../../component/card_view_publish";
|
||||
|
||||
export default function Vote_StatusPublish({
|
||||
listPublish,
|
||||
}: {
|
||||
listPublish: MODEL_VOTING[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
if (_.isEmpty(listPublish))
|
||||
return (
|
||||
<>
|
||||
<ComponentVote_IsEmptyData text="Tidak ada voting" />
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{listPublish.map((e) => (
|
||||
<Box key={e.id}>
|
||||
<ComponentVote_CardViewPublish
|
||||
data={e}
|
||||
path={RouterVote.detail_publish}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
31
src/app_modules/vote/main/status/reject.tsx
Normal file
31
src/app_modules/vote/main/status/reject.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
"use client";
|
||||
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import ComponentVote_CardViewStatus from "../../component/card_view_status";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import { Box, Stack } from "@mantine/core";
|
||||
import ComponentVote_IsEmptyData from "../../component/is_empty_data";
|
||||
import _ from "lodash";
|
||||
|
||||
export default function Vote_StatusReject({
|
||||
listReject,
|
||||
}: {
|
||||
listReject: MODEL_VOTING[];
|
||||
}) {
|
||||
if (_.isEmpty(listReject))
|
||||
return <ComponentVote_IsEmptyData text="Tidak ada review" />;
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{listReject.map((e) => (
|
||||
<Box key={e.id}>
|
||||
<ComponentVote_CardViewStatus
|
||||
path={RouterVote.detail_reject}
|
||||
data={e}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -3,13 +3,18 @@
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import ComponentVote_CardViewStatus from "../../component/card_view_status";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import { Box, Stack } from "@mantine/core";
|
||||
import { Box, Center, Stack, Text } from "@mantine/core";
|
||||
import _ from "lodash";
|
||||
import ComponentVote_IsEmptyData from "../../component/is_empty_data";
|
||||
|
||||
export default function Vote_StatusReview({
|
||||
listReview,
|
||||
}: {
|
||||
listReview: MODEL_VOTING[];
|
||||
}) {
|
||||
if (_.isEmpty(listReview))
|
||||
return <ComponentVote_IsEmptyData text="Tidak ada review" />;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
@@ -10,16 +10,29 @@ export interface MODEL_VOTING {
|
||||
createdAt: Date;
|
||||
updateAt: Date;
|
||||
catatan: string;
|
||||
authorId: string,
|
||||
Author: MODEL_USER
|
||||
authorId: string;
|
||||
Author: MODEL_USER;
|
||||
Voting_DaftarNamaVote: MODEL_VOTING_DAFTAR_NAMA_VOTE[];
|
||||
}
|
||||
|
||||
export interface MODEL_VOTING_DAFTAR_NAMA_VOTE {
|
||||
id: string;
|
||||
value: string;
|
||||
jumlah: number;
|
||||
isActive: boolean;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
votingId: string;
|
||||
}
|
||||
|
||||
export interface MODEL_VOTE_KONTRIBUTOR {
|
||||
id: string;
|
||||
isActive: boolean;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
Author: MODEL_USER;
|
||||
votingId: string;
|
||||
Voting: MODEL_VOTING;
|
||||
Voting_DaftarNamaVote: MODEL_VOTING_DAFTAR_NAMA_VOTE;
|
||||
voting_DaftarNamaVoteId: string;
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
|
||||
import {
|
||||
Card,
|
||||
Stack,
|
||||
Grid,
|
||||
Avatar,
|
||||
Divider,
|
||||
Badge,
|
||||
Group,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function ComponentVote_CardViewPublish({
|
||||
path,
|
||||
pilihanSaya,
|
||||
}: {
|
||||
path: string;
|
||||
pilihanSaya?: boolean;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30} radius={"md"}>
|
||||
{/* Header name */}
|
||||
<Card.Section>
|
||||
<ComponentGlobal_AuthorNameOnHeader />
|
||||
</Card.Section>
|
||||
|
||||
{/* Isi deskripsi */}
|
||||
<Card.Section py={"sm"} onClick={() => router.push(path)}>
|
||||
<Stack>
|
||||
<Text fw={"bold"}>Voting Pemilihan Tempat Makan</Text>
|
||||
<Badge>
|
||||
<Group>
|
||||
<Text>
|
||||
{new Date().toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
<Text>-</Text>
|
||||
<Text>
|
||||
{new Date(
|
||||
moment(Date.now()).add(10, "days").calendar()
|
||||
).toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
</Group>
|
||||
</Badge>
|
||||
<Stack>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Stack align="center" spacing={"xs"}>
|
||||
<Text fz={10}>Voting A</Text>
|
||||
<Avatar radius={100} variant="outline" color="blue">
|
||||
2
|
||||
</Avatar>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Stack align="center" spacing={"xs"}>
|
||||
<Text fz={10}>Voting B</Text>
|
||||
<Avatar radius={100} variant="outline" color="red">
|
||||
3
|
||||
</Avatar>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
|
||||
{pilihanSaya ? (
|
||||
<Card.Section py={"sm"}>
|
||||
<Stack align="center">
|
||||
<Title order={5}>Pilihan Saya : A</Title>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
"use client";
|
||||
import {
|
||||
Card,
|
||||
Stack,
|
||||
Center,
|
||||
Title,
|
||||
Badge,
|
||||
Group,
|
||||
Radio,
|
||||
Grid,
|
||||
Text,
|
||||
Avatar,
|
||||
Divider,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
|
||||
export default function ComponentVote_DaftarVoter() {
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
<Center>
|
||||
<Title order={5}>Daftar Voting</Title>
|
||||
</Center>
|
||||
{Array(5)
|
||||
.fill(0)
|
||||
.map((e, i) => (
|
||||
<Stack spacing={"xs"} key={i}>
|
||||
<Grid>
|
||||
<Grid.Col span={2}>
|
||||
<Avatar radius={"xl"} />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={8}>
|
||||
<Stack justify="center" h={"100%"}>
|
||||
<Text truncate>Nama User</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={2}>
|
||||
<Stack justify="center" h={"100%"}>
|
||||
<Text truncate>A</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Divider />
|
||||
</Stack>
|
||||
))}
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Avatar,
|
||||
Box,
|
||||
Card,
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
List,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
|
||||
export default function ComponentVote_HasilVoting() {
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
<Center>
|
||||
<Title order={5}>Hasil Voting</Title>
|
||||
</Center>
|
||||
{/* <Group position="center">
|
||||
<Group>
|
||||
<Text>
|
||||
Voting A :{" "}
|
||||
<Text span inherit fw={"bold"}>
|
||||
10
|
||||
</Text>
|
||||
</Text>
|
||||
</Group>
|
||||
<Group>
|
||||
<Text>
|
||||
Voting B :{" "}
|
||||
<Text span inherit fw={"bold"}>
|
||||
12
|
||||
</Text>
|
||||
</Text>
|
||||
</Group>
|
||||
</Group> */}
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Stack align="center">
|
||||
<Avatar
|
||||
radius={100}
|
||||
size={100}
|
||||
variant="outline"
|
||||
color="blue"
|
||||
>
|
||||
2
|
||||
</Avatar>
|
||||
<Text>Voting A</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Stack align="center">
|
||||
<Avatar
|
||||
radius={100}
|
||||
size={100}
|
||||
variant="outline"
|
||||
color="red"
|
||||
>
|
||||
3
|
||||
</Avatar>
|
||||
<Text>Voting B</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Badge,
|
||||
Card,
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
Radio,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import ComponentVote_HasilVoting from "../../component/detail/hasil_voting";
|
||||
import ComponentVote_DaftarVoter from "../../component/detail/daftar_voter";
|
||||
|
||||
export default function Vote_DetailKontribusi() {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<TampilanDataVoting />
|
||||
<ComponentVote_HasilVoting />
|
||||
<ComponentVote_DaftarVoter />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TampilanDataVoting() {
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
<Card.Section px={"xs"}>
|
||||
<Stack spacing={"lg"}>
|
||||
<Center>
|
||||
<Title order={5}>Judul voting</Title>
|
||||
</Center>
|
||||
<Text>
|
||||
Deskripsi: Lorem, ipsum dolor sit amet consectetur adipisicing
|
||||
elit. Mollitia possimus repellendus in, iste voluptatibus sit
|
||||
laborum voluptates aliquam nisi? Earum quas ea quaerat veniam
|
||||
porro, magni nulla consequuntur distinctio at.
|
||||
</Text>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
<Card.Section py={"lg"}>
|
||||
<Stack spacing={0}>
|
||||
<Center>
|
||||
<Text fz={10} fw={"bold"}>
|
||||
Batas Voting
|
||||
</Text>
|
||||
</Center>
|
||||
<Badge>
|
||||
<Group>
|
||||
<Text>
|
||||
{new Date().toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
<Text>-</Text>
|
||||
<Text>
|
||||
{new Date(
|
||||
moment(Date.now()).add(10, "days").calendar()
|
||||
).toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
</Group>
|
||||
</Badge>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Card,
|
||||
Stack,
|
||||
Center,
|
||||
Title,
|
||||
Badge,
|
||||
Group,
|
||||
Radio,
|
||||
Grid,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import ComponentVote_HasilVoting from "../../component/detail/hasil_voting";
|
||||
import ComponentVote_DaftarVoter from "../../component/detail/daftar_voter";
|
||||
|
||||
export default function Vote_MainDetail() {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<TampilanDataVoting />
|
||||
<ComponentVote_HasilVoting />
|
||||
<ComponentVote_DaftarVoter />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TampilanDataVoting() {
|
||||
const listVote = [
|
||||
{
|
||||
id: 1,
|
||||
value: "A",
|
||||
label: "A",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: "B",
|
||||
label: "B",
|
||||
},
|
||||
];
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
<Card.Section px={"xs"}>
|
||||
<Stack spacing={"lg"}>
|
||||
<Center>
|
||||
<Title order={5}>Judul voting</Title>
|
||||
</Center>
|
||||
<Text>
|
||||
Deskripsi: Lorem, ipsum dolor sit amet consectetur adipisicing
|
||||
elit. Mollitia possimus repellendus in, iste voluptatibus sit
|
||||
laborum voluptates aliquam nisi? Earum quas ea quaerat veniam
|
||||
porro, magni nulla consequuntur distinctio at.
|
||||
</Text>
|
||||
|
||||
<Stack spacing={0}>
|
||||
<Center>
|
||||
<Text fz={10} fw={"bold"}>
|
||||
Batas Voting
|
||||
</Text>
|
||||
</Center>
|
||||
<Badge>
|
||||
<Group>
|
||||
<Text>
|
||||
{new Date().toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
<Text>-</Text>
|
||||
<Text>
|
||||
{new Date(
|
||||
moment(Date.now()).add(10, "days").calendar()
|
||||
).toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
</Group>
|
||||
</Badge>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
<Card.Section py={40}>
|
||||
<Stack>
|
||||
<Radio.Group>
|
||||
<Grid>
|
||||
{listVote.map((e) => (
|
||||
<Grid.Col key={e.id} span={"auto"}>
|
||||
<Center>
|
||||
<Radio
|
||||
value={e.value}
|
||||
label={
|
||||
<Text fw={"bold"}>{`Nama Voting ${e.label}`}</Text>
|
||||
}
|
||||
/>
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
))}
|
||||
</Grid>
|
||||
</Radio.Group>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Badge,
|
||||
Card,
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
Radio,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import ComponentVote_DetailData from "../../component/detail/detail_data";
|
||||
import ComponentVote_DaftarVoter from "../../component/detail/daftar_voter";
|
||||
import ComponentVote_HasilVoting from "../../component/detail/hasil_voting";
|
||||
import moment from "moment";
|
||||
|
||||
export default function Vote_DetailPublish() {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{/* <ComponentVote_DetailStatus /> */}
|
||||
<TampilanDataVoting />
|
||||
<ComponentVote_HasilVoting />
|
||||
<ComponentVote_DaftarVoter />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TampilanDataVoting() {
|
||||
return (
|
||||
<>
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
<Card.Section px={"xs"}>
|
||||
<Stack spacing={"lg"}>
|
||||
<Center>
|
||||
<Title order={5}>Judul voting</Title>
|
||||
</Center>
|
||||
<Text>
|
||||
Deskripsi: Lorem, ipsum dolor sit amet consectetur adipisicing
|
||||
elit. Mollitia possimus repellendus in, iste voluptatibus sit
|
||||
laborum voluptates aliquam nisi? Earum quas ea quaerat veniam
|
||||
porro, magni nulla consequuntur distinctio at.
|
||||
</Text>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
<Card.Section py={"lg"}>
|
||||
<Stack spacing={0}>
|
||||
<Center>
|
||||
<Text fz={10} fw={"bold"}>
|
||||
Batas Voting
|
||||
</Text>
|
||||
</Center>
|
||||
<Badge>
|
||||
<Group>
|
||||
<Text>
|
||||
{new Date().toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
<Text>-</Text>
|
||||
<Text>
|
||||
{new Date(
|
||||
moment(Date.now()).add(10, "days").calendar()
|
||||
).toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
</Group>
|
||||
</Badge>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
Card,
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
Radio,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
import moment from "moment";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { gs_vote_status } from "../../global_state";
|
||||
import ComponentVote_DetailData from "../../component/detail/detail_data";
|
||||
|
||||
export default function Vote_DetailReview({ dataVote }: { dataVote : any[]}) {
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={"xl"}>
|
||||
<ComponentVote_DetailData data={dataVote as any} />
|
||||
<ButtonAction />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction() {
|
||||
const router = useRouter();
|
||||
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
|
||||
|
||||
async function onUpdate() {
|
||||
setTabsStatus("Draft");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Batalkan Review", 2000);
|
||||
router.back();
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="red"
|
||||
onClick={() => {
|
||||
onUpdate();
|
||||
}}
|
||||
>
|
||||
Batalkan Review
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
"use client";
|
||||
|
||||
export default function Vote_DetailRiwayatSaya() {
|
||||
return <> riwayat saya</>;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Stack } from "@mantine/core";
|
||||
import ComponentVote_DetailDataTanpaVote from "../../component/detail/detail_data_tanpa_vote";
|
||||
import ComponentVote_HasilVoting from "../../component/detail/hasil_voting";
|
||||
import ComponentVote_DaftarVoter from "../../component/detail/daftar_voter";
|
||||
|
||||
export default function Vote_DetailSemuaRiwayat() {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentVote_DetailDataTanpaVote />
|
||||
<ComponentVote_HasilVoting/>
|
||||
<ComponentVote_DaftarVoter/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import {
|
||||
Button,
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
Stack,
|
||||
Text,
|
||||
TextInput,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { DatePickerInput } from "@mantine/dates";
|
||||
import { useCounter } from "@mantine/hooks";
|
||||
import { IconHome } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import moment from "moment";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { gs_vote_hotMenu, gs_vote_status } from "../global_state";
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
|
||||
export default function Vote_Edit() {
|
||||
const router = useRouter();
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_vote_hotMenu);
|
||||
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack px={"sm"}>
|
||||
<TextInput
|
||||
label="Judul"
|
||||
withAsterisk
|
||||
placeholder="Masukan judul"
|
||||
onChange={() => {}}
|
||||
/>
|
||||
<TextInput
|
||||
label="Deskripsi"
|
||||
withAsterisk
|
||||
placeholder="Masukan deskripsi"
|
||||
onChange={() => {}}
|
||||
/>
|
||||
|
||||
<DatePickerInput
|
||||
label="Jangka Waktu"
|
||||
placeholder="Masukan jangka waktu voting"
|
||||
withAsterisk
|
||||
dropdownType="modal"
|
||||
type="range"
|
||||
excludeDate={(date) => {
|
||||
return moment(date).diff(Date.now(), "days") < 0;
|
||||
}}
|
||||
onChange={(val) => console.log(val)}
|
||||
/>
|
||||
|
||||
<Stack>
|
||||
<Text fw={"bold"} fz={"sm"}>
|
||||
Daftar Voting
|
||||
</Text>
|
||||
|
||||
<Stack>
|
||||
<Grid>
|
||||
<Grid.Col span={"content"}>
|
||||
<Stack h={"100%"} justify="center">
|
||||
<Title order={3}>-</Title>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<TextInput
|
||||
label="Pilihan 1"
|
||||
placeholder="Masukan pilihan 1"
|
||||
withAsterisk
|
||||
onChange={() => {}}
|
||||
/>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.Col span={"content"}>
|
||||
<Stack h={"100%"} justify="center">
|
||||
<Title order={3}>-</Title>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<TextInput
|
||||
label="Pilihan 2"
|
||||
placeholder="Masukan pilihan 2"
|
||||
withAsterisk
|
||||
onChange={() => {}}
|
||||
/>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
<Button
|
||||
mt={"lg"}
|
||||
radius={"xl"}
|
||||
color="green"
|
||||
onClick={() => onSave(router, setHotMenu, setTabsStatus)}
|
||||
>
|
||||
Update
|
||||
</Button>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
async function onSave(
|
||||
router: AppRouterInstance,
|
||||
setHotMenu: any,
|
||||
setTabsStatus: any
|
||||
) {
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Update");
|
||||
setHotMenu(1);
|
||||
setTabsStatus("Draft");
|
||||
router.back();
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Box,
|
||||
Card,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Radio,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import { useRouter } from "next/navigation";
|
||||
import ComponentVote_CardViewPublish from "../component/card_view_publish";
|
||||
|
||||
export default function Vote_Kontribusi() {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{Array(5)
|
||||
.fill(0)
|
||||
.map((e, i) => (
|
||||
<Box key={i}>
|
||||
<ComponentVote_CardViewPublish
|
||||
path={RouterVote.detail_kontribusi}
|
||||
pilihanSaya={true}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
"use client"
|
||||
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import ComponentVote_CardViewStatus from "../../component/card_view_status";
|
||||
|
||||
export default function Vote_StatusDraft() {
|
||||
return (
|
||||
<>
|
||||
<ComponentVote_CardViewStatus path={RouterVote.detail_draft} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Card,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Radio,
|
||||
Skeleton,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
|
||||
export default function Vote_StatusPublish() {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
shadow="lg"
|
||||
withBorder
|
||||
p={30}
|
||||
radius={"md"}
|
||||
onClick={() => {
|
||||
router.push(RouterVote.detail_publish);
|
||||
}}
|
||||
>
|
||||
{/* Isi deskripsi */}
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
<Text fw={"bold"}>Voting Pemilihan Tempat Makan</Text>
|
||||
<Badge>
|
||||
<Group>
|
||||
<Text>
|
||||
{new Date().toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
<Text>-</Text>
|
||||
<Text>
|
||||
{new Date(
|
||||
moment(Date.now()).add(10, "days").calendar()
|
||||
).toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
</Group>
|
||||
</Badge>
|
||||
<Stack>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Stack align="center" spacing={"xs"}>
|
||||
<Text fz={10}>Voting A</Text>
|
||||
<Avatar radius={100} variant="outline" color="blue">
|
||||
2
|
||||
</Avatar>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Stack align="center" spacing={"xs"}>
|
||||
<Text fz={10}>Voting B</Text>
|
||||
<Avatar radius={100} variant="outline" color="red">
|
||||
3
|
||||
</Avatar>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import ComponentVote_CardViewStatus from "../../component/card_view_status";
|
||||
|
||||
export default function Vote_StatusReject() {
|
||||
return (
|
||||
<>
|
||||
<ComponentVote_CardViewStatus path={RouterVote.detail_reject} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user