import {
AlertDefaultSystem,
BadgeCustom,
BaseBox,
CircleContainer,
Grid,
Spacing,
StackCustom,
TextCustom,
ViewWrapper,
} from "@/components";
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
import { MainColor } from "@/constants/color-palet";
import dayjs from "dayjs";
import { router, useLocalSearchParams } from "expo-router";
import _ from "lodash";
import { List } from "react-native-paper";
export default function AdminVotingDetail() {
const { id, status } = useLocalSearchParams();
const colorBadge = () => {
if (status === "publish") {
return MainColor.green;
} else if (status === "review") {
return MainColor.orange;
} else if (status === "reject") {
return MainColor.red;
} else {
return MainColor.placeholder;
}
};
const listData = [
{
label: "Username",
value: "Bagas Banuna",
},
{
label: "Judul",
value: `Judul Proyek: ${id}Lorem ipsum dolor sit amet consectetur adipisicing elit.`,
},
{
label: "Status",
value: (
{_.startCase(status as string)}
),
},
{
label: "Mulai Voting",
value: dayjs().format("DD/MM/YYYY"),
},
{
label: "Voting Berakhir",
value: dayjs().format("DD/MM/YYYY"),
},
{
label: "Deskripsi",
value: "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
},
{
label: "Daftar Pilhan",
value: (
<>
Pilihan 1}
left={(props) => (
)}
/>
Pilihan 2}
left={(props) => (
)}
/>
Pilihan 3}
left={(props) => (
)}
/>
Pilihan 4}
left={(props) => (
)}
/>
>
),
},
];
return (
<>
}
>
{listData.map((item, i) => (
{item.label}}
value={{item.value}}
/>
))}
{status === "publish" && (
Hasil Voting
{Array.from({length: 4}).map((_, index) => (
Pilihan {index + 1}
))}
)}
{status === "review" && (
{
AlertDefaultSystem({
title: "Publish",
message: "Apakah anda yakin ingin mempublikasikan data ini?",
textLeft: "Cancel",
textRight: "Publish",
onPressLeft: () => {
router.back();
},
onPressRight: () => {
router.back();
},
});
}}
onReject={() => {
router.push(`/admin/voting/${id}/reject-input`);
}}
/>
)}
{status === "reject" && (
{
router.push(`/admin/voting/${id}/reject-input`);
}}
/>
)}
>
);
}