Pull Request branch dev-clone to main #1

Merged
gitea merged 429 commits from dev-clone into main 2024-12-23 09:31:34 +00:00
Showing only changes of commit c2a8c64463 - Show all commits

View File

@ -1,4 +1,14 @@
import { Button, Flex, Modal, ScrollArea } from "@mantine/core"; import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/shadcn/components/ui/dialog";
import { Button } from "@/shadcn/components/ui/button";
import { ScrollArea } from "@/shadcn/components/ui/scroll-area";
// import { Button, Flex, Modal, ScrollArea } from "@mantine/core";
import { useForm } from "@mantine/form"; import { useForm } from "@mantine/form";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { getRouteApi } from "@tanstack/react-router"; import { getRouteApi } from "@tanstack/react-router";
@ -124,91 +134,96 @@ export default function AssessmentRequestManagementFormModal({
const { status } = form.values; const { status } = form.values;
return ( return (
<Modal opened={isOpen} onClose={onClose} title="Detail Permohonan Asesmen"> <Dialog open={isOpen} onOpenChange={onClose}>
<ScrollArea style={{ height: "400px", paddingRight: "15px" }} scrollbarSize={8}> <DialogContent>
{createInputComponents({ <DialogHeader>
disableAll: mutation.isPending, <DialogTitle>Detail Permohonan Asesmen</DialogTitle>
readonlyAll: true, </DialogHeader>
inputs: [ <DialogDescription>
{ <ScrollArea className="h-[400px] w-full rounded-md p-4">
type: "text", {createInputComponents({
label: "Tanggal", disableAll: mutation.isPending,
...form.getInputProps("tanggal"), readonlyAll: true,
}, inputs: [
{ {
type: "text", type: "text",
label: "Nama", label: "Tanggal",
...form.getInputProps("nama"), ...form.getInputProps("tanggal"),
}, },
{ {
type: "text", type: "text",
label: "Posisi", label: "Nama",
...form.getInputProps("posisi"), ...form.getInputProps("nama"),
}, },
{ {
type: "text", type: "text",
label: "Pengalaman Kerja", label: "Posisi",
...form.getInputProps("pengalamanKerja"), ...form.getInputProps("posisi"),
}, },
{ {
type: "text", type: "text",
label: "Email", label: "Pengalaman Kerja",
...form.getInputProps("email"), ...form.getInputProps("pengalamanKerja"),
}, },
{ {
type: "text", type: "text",
label: "Nama Perusahaan", label: "Email",
...form.getInputProps("namaPerusahaan"), ...form.getInputProps("email"),
}, },
{ {
type: "text", type: "text",
label: "Alamat", label: "Nama Perusahaan",
...form.getInputProps("alamat"), ...form.getInputProps("namaPerusahaan"),
}, },
{ {
type: "text", type: "text",
label: "Nomor Telepon", label: "Alamat",
...form.getInputProps("nomorTelepon"), ...form.getInputProps("alamat"),
}, },
{ {
type: "text", type: "text",
label: "Username", label: "Nomor Telepon",
...form.getInputProps("username"), ...form.getInputProps("nomorTelepon"),
}, },
{ {
type: "text", type: "text",
label: "Status", label: "Username",
...form.getInputProps("status"), ...form.getInputProps("username"),
}, },
], {
})} type: "text",
label: "Status",
...form.getInputProps("status"),
},
],
})}
<Flex justify="flex-end" align="center" gap="lg" mt="lg"> <div className="flex justify-end gap-4 mt-4">
<Button variant="outline" onClick={onClose} disabled={mutation.isPending}> <Button onClick={onClose} variant="outline" disabled={mutation.isPending}>
Tutup Tutup
</Button>
{status !== "selesai" && (
<>
<Button
variant="filled"
color="red"
onClick={() => handleStatusChange("ditolak")}
disabled={mutation.isPending}
>
Tolak
</Button> </Button>
<Button {status !== "selesai" && (
variant="filled" <>
color="blue" <Button
onClick={() => handleStatusChange("diterima")} onClick={() => handleStatusChange("ditolak")}
disabled={mutation.isPending} variant="destructive"
> disabled={mutation.isPending}
Terima >
</Button> Tolak
</> </Button>
)} <Button
</Flex> onClick={() => handleStatusChange("diterima")}
</ScrollArea> variant="default"
</Modal> disabled={mutation.isPending}
>
Terima
</Button>
</>
)}
</div>
</ScrollArea>
</DialogDescription>
</DialogContent>
</Dialog>
); );
} }