Tambahan UI di menu ligkungan

This commit is contained in:
2025-06-05 12:23:02 +08:00
parent c9d0ea2a97
commit 5e74447056
31 changed files with 1130 additions and 233 deletions

View File

@@ -4,8 +4,9 @@ import { Box, Button, Paper, Stack, Text, TextInput, Title } from '@mantine/core
import { IconArrowBack, IconImageInPicture } from '@tabler/icons-react';
import { useRouter } from 'next/navigation';
import React from 'react';
import { KeamananEditor } from '../../../keamanan/_com/keamananEditor';
function Page() {
function CreateGotongRoyong() {
const router = useRouter()
return (
<Box>
@@ -19,17 +20,19 @@ function Page() {
<Stack gap="xs">
<Title order={3}>Create Gotong Royong</Title>
<TextInput
label={<Text fz="sm" fw="bold">Judul</Text>}
placeholder="masukkan judul"
label={<Text fz="sm" fw="bold">Judul Gotong Royong</Text>}
placeholder="masukkan judul gotong royong"
/>
<TextInput
label={<Text fz="sm" fw="bold">Kategori</Text>}
placeholder="masukkan kategori"
/>
<TextInput
label={<Text fz="sm" fw="bold">Deskripsi</Text>}
placeholder="masukkan deskripsi"
label={<Text fz="sm" fw="bold">Kategori Gotong Royong</Text>}
placeholder="masukkan kategori gotong royong"
/>
<Box>
<Text fw={"bold"} fz={"sm"}>Deskripsi Gotong Royong</Text>
<KeamananEditor
showSubmit={false}
/>
</Box>
{/* <FileInput
label={<Text fz="sm" fw="bold">Upload Gambar</Text>}
value={file}
@@ -62,4 +65,4 @@ function Page() {
);
}
export default Page;
export default CreateGotongRoyong;

View File

@@ -0,0 +1,66 @@
'use client'
import colors from '@/con/colors';
import { Box, Button, Paper, Stack, Flex, Text, Image } from '@mantine/core';
import { IconArrowBack, IconX, IconEdit } from '@tabler/icons-react';
import { useRouter } from 'next/navigation';
import React from 'react';
// import { ModalKonfirmasiHapus } from '../../../_com/modalKonfirmasiHapus';
function DetailGotongRoyong() {
const router = useRouter();
return (
<Box>
<Box mb={10}>
<Button variant="subtle" onClick={() => router.back()}>
<IconArrowBack color={colors['blue-button']} size={25} />
</Button>
</Box>
<Paper w={{ base: "100%", md: "50%" }} bg={colors['white-1']} p={'md'}>
<Stack>
<Text fz={"xl"} fw={"bold"}>Detail Gotong Royong</Text>
<Paper bg={colors['BG-trans']} p={'md'}>
<Stack gap={"xs"}>
<Box>
<Text fz={"lg"} fw={"bold"}>Judul Gotong Royong</Text>
<Text fz={"lg"}>Test Judul</Text>
</Box>
<Box>
<Text fz={"lg"} fw={"bold"}>Kategori Gotong Royong</Text>
<Text fz={"lg"}>Test Kategori</Text>
</Box>
<Box>
<Text fz={"lg"} fw={"bold"}>Deskripsi Gotong Royong</Text>
<Text fz={"lg"} >Test Deskripsi</Text>
</Box>
<Box>
<Text fz={"lg"} fw={"bold"}>Gambar</Text>
<Image src={"/"} alt="gambar" />
</Box>
<Box>
<Flex gap={"xs"}>
<Button color="red">
<IconX size={20} />
</Button>
<Button onClick={() => router.push('/admin/lingkungan/gotong-royong/edit')} color="green">
<IconEdit size={20} />
</Button>
</Flex>
</Box>
</Stack>
</Paper>
</Stack>
</Paper>
{/* Modal Hapus
<ModalKonfirmasiHapus
opened={modalHapus}
onClose={() => setModalHapus(false)}
onConfirm={handleHapus}
text="Apakah anda yakin ingin menghapus potensi ini?"
/> */}
</Box>
);
}
export default DetailGotongRoyong;

View File

@@ -0,0 +1,68 @@
'use client'
import colors from '@/con/colors';
import { Box, Button, Paper, Stack, Text, TextInput, Title } from '@mantine/core';
import { IconArrowBack, IconImageInPicture } from '@tabler/icons-react';
import { useRouter } from 'next/navigation';
import React from 'react';
import { KeamananEditor } from '../../../keamanan/_com/keamananEditor';
function EditGotongRoyong() {
const router = useRouter()
return (
<Box>
<Box mb={10}>
<Button variant="subtle" onClick={() => router.back()}>
<IconArrowBack color={colors['blue-button']} size={25} />
</Button>
</Box>
<Paper bg={colors['white-1']} p="md" w={{ base: '100%', md: '50%' }}>
<Stack gap="xs">
<Title order={3}>Edit Gotong Royong</Title>
<TextInput
label={<Text fz="sm" fw="bold">Judul Gotong Royong</Text>}
placeholder="masukkan judul gotong royong"
/>
<TextInput
label={<Text fz="sm" fw="bold">Kategori Gotong Royong</Text>}
placeholder="masukkan kategori gotong royong"
/>
<Box>
<Text fw={"bold"} fz={"sm"}>Deskripsi Gotong Royong</Text>
<KeamananEditor
showSubmit={false}
/>
</Box>
{/* <FileInput
label={<Text fz="sm" fw="bold">Upload Gambar</Text>}
value={file}
onChange={async (e) => {
if (!e) return;
setFile(e);
const base64 = await e.arrayBuffer().then((buf) =>
'data:image/png;base64,' + Buffer.from(buf).toString('base64')
);
setPreviewImage(base64);
}}
/> */}
{/* {previewImage ? (
<Image alt="" src={previewImage} w={200} h={200} />
) : (
<Center w={200} h={200} bg="gray">
<IconImageInPicture />
</Center>
)} */}
<Box>
<Text fz="sm" fw="bold">Gambar</Text>
<IconImageInPicture size={25} />
</Box>
<Button bg={colors['blue-button']} >
Simpan
</Button>
</Stack>
</Paper>
</Box>
);
}
export default EditGotongRoyong;

View File

@@ -1,8 +1,10 @@
'use client'
import { Box, Button, Image, Paper, Stack, Table, TableTbody, TableTd, TableTh, TableThead, TableTr, Text } from '@mantine/core';
import { IconDeviceImacCog, IconSearch } from '@tabler/icons-react';
import HeaderSearch from '../../_com/header';
import colors from '@/con/colors';
import JudulList from '../../_com/judulList';
import { useRouter } from 'next/navigation';
function GotongRoyong() {
return (
@@ -18,6 +20,7 @@ function GotongRoyong() {
}
function ListGotongRoyong() {
const router = useRouter();
return (
<Box py={10}>
<Paper bg={colors['white-1']} p={'md'}>
@@ -30,10 +33,10 @@ function ListGotongRoyong() {
<Table striped withRowBorders withTableBorder style={{ minWidth: '700px'}}>
<TableThead>
<TableTr>
<TableTh>Judul</TableTh>
<TableTh>Kategori</TableTh>
<TableTh>Judul Gotong Royong</TableTh>
<TableTh>Kategori Gotong Royong</TableTh>
<TableTh>Image</TableTh>
<TableTh>Deskripsi</TableTh>
<TableTh>Deskripsi Gotong Royong</TableTh>
<TableTh>Detail</TableTh>
</TableTr>
</TableThead>
@@ -50,7 +53,7 @@ function ListGotongRoyong() {
</TableTd>
<TableTd>Deskripsi</TableTd>
<TableTd>
<Button>
<Button onClick={() => router.push('/admin/lingkungan/gotong-royong/detail')}>
<IconDeviceImacCog size={25} />
</Button>
</TableTd>