Update Versi 1.5.27 #32
@@ -1,13 +1,9 @@
|
||||
import { AdminJob_TablePublish } from "@/app_modules/admin/job";
|
||||
import adminJob_getListPublish from "@/app_modules/admin/job/fun/get/get_list_publish";
|
||||
import { AdminJob_getListTableByStatusId } from "@/app_modules/admin/job/fun/get/get_list_table_by_status_id";
|
||||
|
||||
export default async function Page() {
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<AdminJob_TablePublish />
|
||||
</>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<AdminJob_TablePublish />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { AdminJob_TableReview } from "@/app_modules/admin/job";
|
||||
import adminJob_getListReview from "@/app_modules/admin/job/fun/get/get_list_review";
|
||||
|
||||
export default async function Page() {
|
||||
|
||||
|
||||
33
src/app_modules/admin/job/_components/detail/image_view.tsx
Normal file
33
src/app_modules/admin/job/_components/detail/image_view.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
import { Admin_ComponentBoxStyle } from "@/app_modules/admin/_admin_global/_component/comp_admin_boxstyle";
|
||||
import { APIs } from "@/lib";
|
||||
import { Center, Image } from "@mantine/core";
|
||||
import { data } from "autoprefixer";
|
||||
import { useState } from "react";
|
||||
|
||||
export function AdminJob_ComponentImageView({ imageId }: { imageId: string }) {
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Admin_ComponentBoxStyle>
|
||||
<Center h={"100%"}>
|
||||
<Image
|
||||
onLoad={() => setLoading(false)}
|
||||
alt="Foto"
|
||||
src={APIs.GET({ fileId: imageId })}
|
||||
mah={500}
|
||||
maw={300}
|
||||
/>
|
||||
</Center>
|
||||
{isLoading ? (
|
||||
<Center h={"100%"}>
|
||||
<ComponentGlobal_Loader size={30} variant="dots" />
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Admin_ComponentBoxStyle>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -7,9 +7,11 @@ import { APIs } from "@/lib";
|
||||
import { Badge, Center, Grid, Image, SimpleGrid, Text } from "@mantine/core";
|
||||
import { IconImageInPicture } from "@tabler/icons-react";
|
||||
import { useState } from "react";
|
||||
import { AdminJob_ComponentImageView } from "./image_view";
|
||||
|
||||
export function AdminJob_DetailPublish({ data }: { data: MODEL_JOB }) {
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
|
||||
const listData = [
|
||||
{
|
||||
title: "Username",
|
||||
@@ -58,21 +60,9 @@ export function AdminJob_DetailPublish({ data }: { data: MODEL_JOB }) {
|
||||
</Admin_ComponentBoxStyle>
|
||||
|
||||
{data.imageId && (
|
||||
<Admin_ComponentBoxStyle>
|
||||
<Center>
|
||||
<Image
|
||||
onLoad={() => setLoading(false)}
|
||||
alt="Foto"
|
||||
src={APIs.GET({ fileId: data.imageId })}
|
||||
mah={500}
|
||||
maw={300}
|
||||
/>
|
||||
</Center>
|
||||
</Admin_ComponentBoxStyle>
|
||||
<AdminJob_ComponentImageView imageId={data.imageId}/>
|
||||
)}
|
||||
</SimpleGrid>
|
||||
|
||||
{/* <pre style={{ color: "white" }}>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
291
src/app_modules/admin/job/_components/detail/review.tsx
Normal file
291
src/app_modules/admin/job/_components/detail/review.tsx
Normal file
@@ -0,0 +1,291 @@
|
||||
"use client";
|
||||
|
||||
import { MainColor } from "@/app_modules/_global/color";
|
||||
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_InputCountDown } from "@/app_modules/_global/component";
|
||||
import {
|
||||
ComponentGlobal_NotifikasiBerhasil,
|
||||
ComponentGlobal_NotifikasiGagal,
|
||||
} from "@/app_modules/_global/notif_global";
|
||||
import { Admin_ComponentBoxStyle } from "@/app_modules/admin/_admin_global/_component/comp_admin_boxstyle";
|
||||
import adminNotifikasi_funCreateToUser from "@/app_modules/admin/notifikasi/fun/create/fun_create_notif_user";
|
||||
import { MODEL_JOB } from "@/app_modules/job/model/interface";
|
||||
import { IRealtimeData } from "@/lib/global_state";
|
||||
import {
|
||||
Button,
|
||||
Grid,
|
||||
Group,
|
||||
Modal,
|
||||
SimpleGrid,
|
||||
Stack,
|
||||
Text,
|
||||
Textarea,
|
||||
} from "@mantine/core";
|
||||
import { IconBan, IconCircleCheck } from "@tabler/icons-react";
|
||||
import { useState } from "react";
|
||||
import { WibuRealtime } from "wibu-pkg";
|
||||
import { AdminJob_funEditCatatanById } from "../../fun/edit/fun_edit_catatan_by_id";
|
||||
import { AdminJob_funEditStatusPublishById } from "../../fun/edit/fun_edit_status_publish_by_id";
|
||||
import { AdminJob_ComponentImageView } from "./image_view";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export function AdminJob_DetailReview({ data }: { data: MODEL_JOB }) {
|
||||
const router = useRouter();
|
||||
const [publish, setPublish] = useState(false);
|
||||
const [reject, setReject] = useState(false);
|
||||
const [catatan, setCatatan] = useState("");
|
||||
const [isLoadingPublish, setLoadingPublish] = useState(false);
|
||||
const [isLoadingReject, setLoadingReject] = useState(false);
|
||||
|
||||
const listData = [
|
||||
{
|
||||
title: "Username",
|
||||
value: data.Author.username,
|
||||
},
|
||||
{
|
||||
title: "Judul",
|
||||
value: data.title,
|
||||
},
|
||||
{
|
||||
title: "Konten",
|
||||
value: <div dangerouslySetInnerHTML={{ __html: data.content }} />,
|
||||
},
|
||||
{
|
||||
title: "Deskripsi",
|
||||
value: <div dangerouslySetInnerHTML={{ __html: data.deskripsi }} />,
|
||||
},
|
||||
];
|
||||
|
||||
async function onPublish() {
|
||||
try {
|
||||
setLoadingPublish(true);
|
||||
const publish = await AdminJob_funEditStatusPublishById(data.id);
|
||||
if (publish.status === 200) {
|
||||
const dataNotifikasi: IRealtimeData = {
|
||||
appId: publish.data?.id as any,
|
||||
status: publish.data?.MasterStatus?.name as any,
|
||||
userId: publish.data?.authorId as any,
|
||||
pesan: publish.data?.title as any,
|
||||
kategoriApp: "JOB",
|
||||
title: "Job publish",
|
||||
};
|
||||
|
||||
const createNotifikasi = await adminNotifikasi_funCreateToUser({
|
||||
data: dataNotifikasi as any,
|
||||
});
|
||||
|
||||
if (createNotifikasi.status === 201) {
|
||||
WibuRealtime.setData({
|
||||
type: "notification",
|
||||
pushNotificationTo: "USER",
|
||||
dataMessage: dataNotifikasi,
|
||||
});
|
||||
|
||||
WibuRealtime.setData({
|
||||
type: "trigger",
|
||||
pushNotificationTo: "USER",
|
||||
dataMessage: dataNotifikasi,
|
||||
});
|
||||
}
|
||||
setPublish(false);
|
||||
ComponentGlobal_NotifikasiBerhasil(publish.message);
|
||||
|
||||
router.back();
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(publish.message);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("Error,", error);
|
||||
} finally {
|
||||
setLoadingPublish(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function onReject() {
|
||||
try {
|
||||
setLoadingReject(true);
|
||||
const reject = await AdminJob_funEditCatatanById(data.id, catatan);
|
||||
|
||||
if (reject.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(reject.message);
|
||||
const dataNotifikasi: IRealtimeData = {
|
||||
appId: reject.data?.id as any,
|
||||
status: reject.data?.MasterStatus?.name as any,
|
||||
userId: reject.data?.authorId as any,
|
||||
pesan: reject.data?.title as any,
|
||||
kategoriApp: "JOB",
|
||||
title: "Job reject",
|
||||
};
|
||||
|
||||
const createRejectNotifikasi = await adminNotifikasi_funCreateToUser({
|
||||
data: dataNotifikasi as any,
|
||||
});
|
||||
|
||||
if (createRejectNotifikasi.status === 201) {
|
||||
WibuRealtime.setData({
|
||||
type: "notification",
|
||||
pushNotificationTo: "USER",
|
||||
dataMessage: dataNotifikasi,
|
||||
});
|
||||
}
|
||||
setReject(false);
|
||||
router.back();
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(reject.message);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("Error reject", error);
|
||||
} finally {
|
||||
setLoadingReject(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<SimpleGrid cols={2}>
|
||||
<Admin_ComponentBoxStyle>
|
||||
{listData.map((item, index) => (
|
||||
<Grid key={index}>
|
||||
<Grid.Col span={2}>
|
||||
<Text>{item.title}</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={1}>
|
||||
<Text>:</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text>{item.value}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
))}
|
||||
|
||||
<Grid mt={"xl"}>
|
||||
<Grid.Col span={2}></Grid.Col>
|
||||
<Grid.Col span={1}></Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Group spacing={"xl"}>
|
||||
<Button
|
||||
color={"green"}
|
||||
leftIcon={<IconCircleCheck />}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
setPublish(true);
|
||||
}}
|
||||
>
|
||||
Publish
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
color={"red"}
|
||||
leftIcon={<IconBan />}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
setReject(true);
|
||||
}}
|
||||
>
|
||||
Reject
|
||||
</Button>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Admin_ComponentBoxStyle>
|
||||
|
||||
{data.imageId && <AdminJob_ComponentImageView imageId={data.imageId} />}
|
||||
</SimpleGrid>
|
||||
|
||||
{/* PUBLISH MODAL */}
|
||||
<Modal
|
||||
styles={{
|
||||
header: { backgroundColor: AdminColor.softBlue },
|
||||
body: { backgroundColor: AdminColor.softBlue },
|
||||
title: { color: AdminColor.white },
|
||||
}}
|
||||
title={"Apakah anda yakin ingin mem-publish job ini ?"}
|
||||
withCloseButton={false}
|
||||
opened={publish}
|
||||
onClose={() => {
|
||||
setPublish(false);
|
||||
}}
|
||||
size={"sm"}
|
||||
centered
|
||||
>
|
||||
<Stack>
|
||||
<Group position="center">
|
||||
<Button radius={"xl"} onClick={() => setPublish(false)}>
|
||||
Batal
|
||||
</Button>
|
||||
<Button
|
||||
loading={isLoadingPublish}
|
||||
loaderPosition="center"
|
||||
style={{ transition: "0.5s", backgroundColor: MainColor.green }}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onPublish();
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
|
||||
{/* REJECT MODAL */}
|
||||
<Modal
|
||||
styles={{
|
||||
header: { backgroundColor: AdminColor.softBlue },
|
||||
body: { backgroundColor: AdminColor.softBlue },
|
||||
title: { color: AdminColor.white },
|
||||
}}
|
||||
opened={reject}
|
||||
onClose={() => {
|
||||
setReject(false);
|
||||
}}
|
||||
withCloseButton={false}
|
||||
size={"sm"}
|
||||
centered
|
||||
>
|
||||
<Stack>
|
||||
<Stack spacing={5}>
|
||||
<Textarea
|
||||
minRows={3}
|
||||
maxRows={5}
|
||||
maxLength={300}
|
||||
autosize
|
||||
label={
|
||||
<Text c={AdminColor.white} fw={"bold"}>
|
||||
Alasan Penolakan
|
||||
</Text>
|
||||
}
|
||||
placeholder="Masukkan alasan penolakan lowongan ini"
|
||||
onChange={(val) => setCatatan(val.currentTarget.value)}
|
||||
/>
|
||||
<ComponentGlobal_InputCountDown
|
||||
maxInput={300}
|
||||
lengthInput={catatan.length}
|
||||
/>
|
||||
</Stack>
|
||||
<Group position="right">
|
||||
<Button radius={"xl"} onClick={() => setReject(false)}>
|
||||
Batal
|
||||
</Button>
|
||||
<Button
|
||||
loading={isLoadingReject}
|
||||
loaderPosition="center"
|
||||
style={{ transition: "0.5s" }}
|
||||
bg={MainColor.green}
|
||||
color="green"
|
||||
disabled={catatan === "" ? true : false}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onReject();
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
|
||||
{/* <pre style={{ color: "white" }}>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -9,11 +9,13 @@ import { useShallowEffect } from "@mantine/hooks";
|
||||
import { clientLogger } from "@/util/clientLogger";
|
||||
import { apiGetOneJobById } from "../lib/api_fetch_admin_job";
|
||||
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
|
||||
import { AdminJob_DetailPublish } from "../_components/detail_status";
|
||||
import { AdminJob_DetailPublish } from "../_components/detail/publish";
|
||||
import { MODEL_JOB } from "@/app_modules/job/model/interface";
|
||||
import { AdminJob_DetailReview } from "../_components/detail/review";
|
||||
|
||||
export function AdminJob_ViewDetailPublish() {
|
||||
const param = useParams<{ id: string; status: string }>();
|
||||
const [data, setData] = useState();
|
||||
const param = useParams<{ id: string }>();
|
||||
const [data, setData] = useState<MODEL_JOB>();
|
||||
|
||||
useShallowEffect(() => {
|
||||
handleLoadData();
|
||||
@@ -37,16 +39,19 @@ export function AdminJob_ViewDetailPublish() {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name={`Detail ${param.status} `} />
|
||||
<ComponentAdminGlobal_HeaderTamplate name={`Detail data`} />
|
||||
<AdminGlobal_ComponentBackButton />
|
||||
|
||||
{!data ? (
|
||||
<SimpleGrid cols={2}>
|
||||
<CustomSkeleton height={500} width={"100%"} />
|
||||
<CustomSkeleton height={500} width={"100%"} />
|
||||
</SimpleGrid>
|
||||
) : (
|
||||
) : data.MasterStatus.name === "Publish" ? (
|
||||
<AdminJob_DetailPublish data={data} />
|
||||
) : data.MasterStatus.name === "Review" ? (
|
||||
<AdminJob_DetailReview data={data} />
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Stack>
|
||||
</>
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import { RouterAdminGlobal } from "@/lib";
|
||||
import {
|
||||
gs_adminJob_triggerReview,
|
||||
IRealtimeData,
|
||||
} from "@/lib/global_state";
|
||||
import { gs_adminJob_triggerReview, IRealtimeData } from "@/lib/global_state";
|
||||
import { ComponentGlobal_InputCountDown } from "@/app_modules/_global/component";
|
||||
import {
|
||||
ComponentGlobal_NotifikasiBerhasil,
|
||||
@@ -25,6 +22,7 @@ import {
|
||||
Text,
|
||||
Affix,
|
||||
rem,
|
||||
Box,
|
||||
} from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import {
|
||||
@@ -45,10 +43,15 @@ import { AdminJob_funEditStatusPublishById } from "../fun/edit/fun_edit_status_p
|
||||
import adminJob_getListReview from "../fun/get/get_list_review";
|
||||
import { useAtom } from "jotai";
|
||||
import { AccentColor } from "@/app_modules/_global/color";
|
||||
import { AdminColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import {
|
||||
AdminColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { clientLogger } from "@/util/clientLogger";
|
||||
import { apiGetAdminJobByStatus } from "../lib/api_fetch_admin_job";
|
||||
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
|
||||
import Admin_DetailButton from "../../_admin_global/_component/button/detail_button";
|
||||
import { RouterAdminJob } from "@/lib/router_admin/router_admin_job";
|
||||
|
||||
export default function AdminJob_ViewTavleReview() {
|
||||
const router = useRouter();
|
||||
@@ -61,6 +64,8 @@ export default function AdminJob_ViewTavleReview() {
|
||||
const [jobId, setJobId] = useState("");
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [catatan, setCatatan] = useState("");
|
||||
const [isLoadingShowImage, setLoadingShowImage] = useState(false);
|
||||
const [dataId, setDataId] = useState("");
|
||||
|
||||
// Realtime
|
||||
const [isAdminJob_TriggerReview, setIsAdminJob_TriggerReview] = useAtom(
|
||||
@@ -72,28 +77,26 @@ export default function AdminJob_ViewTavleReview() {
|
||||
loadInitialData();
|
||||
}, [activePage, isSearch]);
|
||||
|
||||
|
||||
const loadInitialData = async () => {
|
||||
try {
|
||||
const response = await apiGetAdminJobByStatus({
|
||||
name: "Review",
|
||||
page: `${activePage}`,
|
||||
search: isSearch
|
||||
})
|
||||
|
||||
search: isSearch,
|
||||
});
|
||||
|
||||
if (response?.success && response?.data.data) {
|
||||
setData(response.data.data);
|
||||
setNPage(response.data.nPage || 1);
|
||||
} else {
|
||||
console.error("Invliad data format recieved", response)
|
||||
console.error("Invliad data format recieved", response);
|
||||
setData([]);
|
||||
}
|
||||
} catch (error) {
|
||||
clientLogger.error("Error get data table publish", error);
|
||||
setData([]);
|
||||
}
|
||||
}
|
||||
};
|
||||
async function onLoadData() {
|
||||
loadInitialData();
|
||||
setIsLoading(false);
|
||||
@@ -104,11 +107,11 @@ export default function AdminJob_ViewTavleReview() {
|
||||
const onSearch = async (searchTerm: string) => {
|
||||
setSearch(searchTerm);
|
||||
setActivePage(1);
|
||||
}
|
||||
};
|
||||
|
||||
const onPageClick = (page: number) => {
|
||||
setActivePage(page);
|
||||
}
|
||||
};
|
||||
|
||||
const renderTableBody = () => {
|
||||
if (!Array.isArray(data) || data.length === 0) {
|
||||
@@ -120,45 +123,46 @@ export default function AdminJob_ViewTavleReview() {
|
||||
</Center>
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
);
|
||||
}
|
||||
return data.map((e, i) => (
|
||||
return data?.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Center w={150}>
|
||||
<Center>
|
||||
<Text c={AdminColor.white}>{e?.Author?.username}</Text>
|
||||
</Center>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<Spoiler
|
||||
c={AdminColor.white}
|
||||
w={150}
|
||||
maxHeight={50}
|
||||
hideLabel="sembunyikan"
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.title}
|
||||
</Spoiler>
|
||||
<Center>
|
||||
<Box w={150}>
|
||||
<Text c={"white"} truncate>
|
||||
{e.title}
|
||||
</Text>
|
||||
</Box>
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center w={150}>
|
||||
<Center>
|
||||
{e.imageId ? (
|
||||
<Button
|
||||
loaderPosition="center"
|
||||
loading={isLoading && jobId == e?.id}
|
||||
loading={isLoadingShowImage && e.id === dataId}
|
||||
color="green"
|
||||
radius={"xl"}
|
||||
leftIcon={<IconPhotoCheck />}
|
||||
onClick={() => {
|
||||
setJobId(e?.id);
|
||||
setIsLoading(true);
|
||||
router.push(RouterAdminGlobal.preview_image({ id: e.imageId }));
|
||||
setLoadingShowImage(true);
|
||||
setDataId(e.id);
|
||||
router.push(
|
||||
RouterAdminGlobal.preview_image({ id: e.imageId })
|
||||
);
|
||||
}}
|
||||
>
|
||||
Lihat
|
||||
</Button>
|
||||
) : (
|
||||
<Center w={150}>
|
||||
<Center>
|
||||
<Text c={AdminColor.white} fw={"bold"} fz={"xs"} fs={"italic"}>
|
||||
Tidak ada poster
|
||||
</Text>
|
||||
@@ -167,66 +171,121 @@ export default function AdminJob_ViewTavleReview() {
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
style={{ color: AdminColor.white }}
|
||||
hideLabel="sembunyikan"
|
||||
w={250}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.content }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
style={{ color: AdminColor.white }}
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.deskripsi }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Stack>
|
||||
<Stack align="center">
|
||||
<Button
|
||||
color={"green"}
|
||||
leftIcon={<IconCircleCheck />}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
setJobId(e?.id);
|
||||
setPublish(true);
|
||||
}
|
||||
|
||||
}
|
||||
>
|
||||
Publish
|
||||
</Button>
|
||||
<Button
|
||||
color={"red"}
|
||||
leftIcon={<IconBan />}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
setReject(true);
|
||||
setJobId(e.id);
|
||||
}}
|
||||
>
|
||||
Reject
|
||||
</Button>
|
||||
</Stack>
|
||||
</Stack>
|
||||
<Center>
|
||||
<Admin_DetailButton path={RouterAdminJob.detail({ id: e.id })} />
|
||||
</Center>
|
||||
</td>
|
||||
</tr>
|
||||
));
|
||||
}
|
||||
|
||||
// return data.map((e, i) => (
|
||||
// <tr key={i}>
|
||||
// <td>
|
||||
// <Center w={150}>
|
||||
// <Text c={AdminColor.white}>{e?.Author?.username}</Text>
|
||||
// </Center>
|
||||
// </td>
|
||||
// <td>
|
||||
// <Spoiler
|
||||
// c={AdminColor.white}
|
||||
// w={150}
|
||||
// maxHeight={50}
|
||||
// hideLabel="sembunyikan"
|
||||
// showLabel="tampilkan"
|
||||
// >
|
||||
// {e.title}
|
||||
// </Spoiler>
|
||||
// </td>
|
||||
// <td>
|
||||
// <Center w={150}>
|
||||
// {e.imageId ? (
|
||||
// <Button
|
||||
// loaderPosition="center"
|
||||
// loading={isLoading && jobId == e?.id}
|
||||
// color="green"
|
||||
// radius={"xl"}
|
||||
// leftIcon={<IconPhotoCheck />}
|
||||
// onClick={() => {
|
||||
// setJobId(e?.id);
|
||||
// setIsLoading(true);
|
||||
// router.push(RouterAdminGlobal.preview_image({ id: e.imageId }));
|
||||
// }}
|
||||
// >
|
||||
// Lihat
|
||||
// </Button>
|
||||
// ) : (
|
||||
// <Center w={150}>
|
||||
// <Text c={AdminColor.white} fw={"bold"} fz={"xs"} fs={"italic"}>
|
||||
// Tidak ada poster
|
||||
// </Text>
|
||||
// </Center>
|
||||
// )}
|
||||
// </Center>
|
||||
// </td>
|
||||
// <td>
|
||||
// <Spoiler
|
||||
// style={{ color: AdminColor.white }}
|
||||
// hideLabel="sembunyikan"
|
||||
// w={250}
|
||||
// maxHeight={50}
|
||||
// showLabel="tampilkan"
|
||||
// >
|
||||
// <div dangerouslySetInnerHTML={{ __html: e.content }} />
|
||||
// </Spoiler>
|
||||
// </td>
|
||||
// <td>
|
||||
// <Spoiler
|
||||
// style={{ color: AdminColor.white }}
|
||||
// hideLabel="sembunyikan"
|
||||
// w={400}
|
||||
// maxHeight={50}
|
||||
// showLabel="tampilkan"
|
||||
// >
|
||||
// <div dangerouslySetInnerHTML={{ __html: e.deskripsi }} />
|
||||
// </Spoiler>
|
||||
// </td>
|
||||
// <td>
|
||||
// <Stack>
|
||||
// <Stack align="center">
|
||||
// <Button
|
||||
// color={"green"}
|
||||
// leftIcon={<IconCircleCheck />}
|
||||
// radius={"xl"}
|
||||
// onClick={() => {
|
||||
// setJobId(e?.id);
|
||||
// setPublish(true);
|
||||
// }
|
||||
|
||||
// }
|
||||
// >
|
||||
// Publish
|
||||
// </Button>
|
||||
// <Button
|
||||
// color={"red"}
|
||||
// leftIcon={<IconBan />}
|
||||
// radius={"xl"}
|
||||
// onClick={() => {
|
||||
// setReject(true);
|
||||
// setJobId(e.id);
|
||||
// }}
|
||||
// >
|
||||
// Reject
|
||||
// </Button>
|
||||
// </Stack>
|
||||
// </Stack>
|
||||
// </td>
|
||||
// </tr>
|
||||
// ));
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
styles={{ header: { backgroundColor: AdminColor.softBlue }, body: { backgroundColor: AdminColor.softBlue}, title: { color: AdminColor.white } }}
|
||||
styles={{
|
||||
header: { backgroundColor: AdminColor.softBlue },
|
||||
body: { backgroundColor: AdminColor.softBlue },
|
||||
title: { color: AdminColor.white },
|
||||
}}
|
||||
title={"Apakah anda yakin ingin mempublish job ini?"}
|
||||
withCloseButton={false}
|
||||
opened={publish}
|
||||
@@ -251,7 +310,7 @@ export default function AdminJob_ViewTavleReview() {
|
||||
setData(val.data);
|
||||
setNPage(val.nPage);
|
||||
},
|
||||
})
|
||||
});
|
||||
setPublish(false);
|
||||
}}
|
||||
>
|
||||
@@ -262,7 +321,11 @@ export default function AdminJob_ViewTavleReview() {
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
styles={{ header: { backgroundColor: AdminColor.softBlue }, body: { backgroundColor: AdminColor.softBlue}, title: { color: AdminColor.white } }}
|
||||
styles={{
|
||||
header: { backgroundColor: AdminColor.softBlue },
|
||||
body: { backgroundColor: AdminColor.softBlue },
|
||||
title: { color: AdminColor.white },
|
||||
}}
|
||||
opened={reject}
|
||||
onClose={() => {
|
||||
setReject(false);
|
||||
@@ -278,7 +341,11 @@ export default function AdminJob_ViewTavleReview() {
|
||||
maxRows={5}
|
||||
maxLength={300}
|
||||
autosize
|
||||
label={<Text c={AdminColor.white} fw={"bold"}>Alasan Penolakan</Text>}
|
||||
label={
|
||||
<Text c={AdminColor.white} fw={"bold"}>
|
||||
Alasan Penolakan
|
||||
</Text>
|
||||
}
|
||||
placeholder="Masukkan alasan penolakan lowongan ini"
|
||||
onChange={(val) => setCatatan(val.currentTarget.value)}
|
||||
/>
|
||||
@@ -292,7 +359,7 @@ export default function AdminJob_ViewTavleReview() {
|
||||
Batal
|
||||
</Button>
|
||||
<Button
|
||||
style={{ transition: "0.5s", }}
|
||||
style={{ transition: "0.5s" }}
|
||||
bg={MainColor.green}
|
||||
disabled={catatan === "" ? true : false}
|
||||
radius={"xl"}
|
||||
@@ -314,7 +381,6 @@ export default function AdminJob_ViewTavleReview() {
|
||||
</Stack>
|
||||
</Modal>
|
||||
|
||||
|
||||
<Stack spacing={"xs"} h={"100%"}>
|
||||
<ComponentAdminGlobal_TitlePage
|
||||
name="Review"
|
||||
@@ -365,7 +431,6 @@ export default function AdminJob_ViewTavleReview() {
|
||||
p={"md"}
|
||||
w={"100%"}
|
||||
h={"100%"}
|
||||
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -373,17 +438,11 @@ export default function AdminJob_ViewTavleReview() {
|
||||
<Center c={AdminColor.white}>Author</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Text c={AdminColor.white}>Judul</Text>
|
||||
<Center c={AdminColor.white}>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center c={AdminColor.white}>Poster</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Text c={AdminColor.white}>Syarat Ketentuan</Text>
|
||||
</th>
|
||||
<th>
|
||||
<Text c={AdminColor.white}>Deskripsi</Text>
|
||||
</th>
|
||||
<th>
|
||||
<Center c={AdminColor.white}>Aksi</Center>
|
||||
</th>
|
||||
|
||||
@@ -33,6 +33,7 @@ import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { apiGetAdminJobByStatus } from "../../lib/api_fetch_admin_job";
|
||||
import Admin_DetailButton from "@/app_modules/admin/_admin_global/_component/button/detail_button";
|
||||
import { RouterAdminJob } from "@/lib/router_admin/router_admin_job";
|
||||
|
||||
export default function AdminJob_TablePublish() {
|
||||
return (
|
||||
@@ -155,7 +156,9 @@ function TableStatus() {
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Admin_DetailButton path={`/dev/admin/job/${e.id}/publish`} />
|
||||
<Admin_DetailButton
|
||||
path={String(RouterAdminJob.detail({ id: e.id }))}
|
||||
/>
|
||||
</Center>
|
||||
</td>
|
||||
{/* <td>
|
||||
|
||||
@@ -5,4 +5,5 @@ export const RouterAdminJob = {
|
||||
reject: "/dev/admin/job/child/reject",
|
||||
arsip: "/dev/admin/job/child/arsip",
|
||||
detail_poster: "/dev/admin/job/detail/poster/",
|
||||
detail: ({ id }: { id: string }) => `/dev/admin/job/${id}`,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user