upd: tambah grup pada project
This commit is contained in:
@@ -1,28 +1,52 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { LayoutDrawer, LayoutNavbarNew, WARNA } from "@/module/_global";
|
import { LayoutDrawer, LayoutNavbarNew, WARNA } from "@/module/_global";
|
||||||
import { Box, Button, Center, Flex, Group, Input, Stack, Text } from "@mantine/core";
|
import { Box, Button, Center, Flex, Group, Select, Stack, Text, TextInput } from "@mantine/core";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { IoIosArrowDropright } from "react-icons/io";
|
import { IoIosArrowDropright } from "react-icons/io";
|
||||||
import { BsFiletypeCsv } from "react-icons/bs";
|
import { BsFiletypeCsv } from "react-icons/bs";
|
||||||
import ResultsDateAndTask from "./results_date-and_task";
|
import ResultsDateAndTask from "./results_date-and_task";
|
||||||
import ResultsFile from "./results_file";
|
import ResultsFile from "./results_file";
|
||||||
|
import LayoutModal from "@/module/_global/layout/layout_modal";
|
||||||
|
import toast from "react-hot-toast";
|
||||||
|
|
||||||
export default function CreateProject({ searchParams }: { searchParams: any }) {
|
export default function CreateProject({ searchParams }: { searchParams: any }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [openDrawer, setOpenDrawer] = useState(false);
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
|
const [isModal, setModal] = useState(false)
|
||||||
|
|
||||||
|
function onTrue(val: boolean) {
|
||||||
|
if (val) {
|
||||||
|
toast.success("Sukses! Data tersimpan");
|
||||||
|
router.push('/project')
|
||||||
|
}
|
||||||
|
setModal(false)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<LayoutNavbarNew back="/project" title="tambah proyek" menu />
|
<LayoutNavbarNew back="/project" title="tambah proyek" menu />
|
||||||
<Box p={20}>
|
<Box p={20}>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Input
|
<Select
|
||||||
|
placeholder="Pilih Grup" label="Grup" w={"100%"} size="md" required withAsterisk radius={30}
|
||||||
styles={{
|
styles={{
|
||||||
input: {
|
input: {
|
||||||
border: `1px solid ${"#D6D8F6"}`,
|
border: `1px solid ${"#D6D8F6"}`,
|
||||||
borderRadius: 10,
|
borderRadius: 10,
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
data={['Dinas', 'Adat', 'LPD', 'PKK']}
|
||||||
|
/>
|
||||||
|
<TextInput
|
||||||
|
label="Proyek"
|
||||||
|
styles={{
|
||||||
|
input: {
|
||||||
|
border: `1px solid ${"#D6D8F6"}`,
|
||||||
|
borderRadius: 10,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
required withAsterisk
|
||||||
placeholder="Nama Proyek"
|
placeholder="Nama Proyek"
|
||||||
size="md"
|
size="md"
|
||||||
/>
|
/>
|
||||||
@@ -69,14 +93,12 @@ export default function CreateProject({ searchParams }: { searchParams: any }) {
|
|||||||
(searchParams.button == 'yes') &&
|
(searchParams.button == 'yes') &&
|
||||||
<>
|
<>
|
||||||
<Box mt="xl">
|
<Box mt="xl">
|
||||||
<Button color="white" bg={WARNA.biruTua} size="lg" radius={30} fullWidth onClick={() => router.push('/project')}>
|
<Button color="white" bg={WARNA.biruTua} size="lg" radius={30} fullWidth onClick={() => setModal(true)}>
|
||||||
Simpan
|
Simpan
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
|
|
||||||
@@ -125,6 +147,10 @@ export default function CreateProject({ searchParams }: { searchParams: any }) {
|
|||||||
</Box>
|
</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
</LayoutDrawer>
|
</LayoutDrawer>
|
||||||
|
|
||||||
|
<LayoutModal opened={isModal} onClose={() => setModal(false)}
|
||||||
|
description="Apakah Anda yakin ingin mengubah data?"
|
||||||
|
onYes={(val) => { onTrue(val) }} />
|
||||||
</Box >
|
</Box >
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user