update: dashboard admin
Deskripsi: - tampilan detail pengaduan No Issues
This commit is contained in:
@@ -2,18 +2,21 @@ import apiFetch from "@/lib/apiFetch";
|
|||||||
import {
|
import {
|
||||||
Anchor,
|
Anchor,
|
||||||
Badge,
|
Badge,
|
||||||
|
Button,
|
||||||
Card,
|
Card,
|
||||||
Container,
|
Container,
|
||||||
Divider,
|
Divider,
|
||||||
Flex,
|
Flex,
|
||||||
Grid,
|
Grid,
|
||||||
Group,
|
Group,
|
||||||
|
Modal,
|
||||||
Stack,
|
Stack,
|
||||||
Table,
|
Table,
|
||||||
Text,
|
Text,
|
||||||
|
Textarea,
|
||||||
Title
|
Title
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
||||||
import {
|
import {
|
||||||
IconAlignJustified,
|
IconAlignJustified,
|
||||||
IconCategory,
|
IconCategory,
|
||||||
@@ -51,7 +54,41 @@ export default function DetailPengaduanPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function DetailDataPengaduan() {
|
function DetailDataPengaduan() {
|
||||||
|
const [opened, { open, close }] = useDisclosure(false);
|
||||||
|
const [catModal, setCatModal] = useState<'tolak' | 'terima'>('tolak');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
<Modal opened={opened} onClose={close} title={"Konfirmasi"} centered overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}>
|
||||||
|
<Stack gap="sm">
|
||||||
|
{
|
||||||
|
catModal === 'tolak'
|
||||||
|
? (
|
||||||
|
<>
|
||||||
|
<Text>Anda yakin ingin menolak pengaduan ini? Berikan alasan penolakan</Text>
|
||||||
|
|
||||||
|
<Textarea size="md" minRows={5} />
|
||||||
|
<Group justify="center" grow>
|
||||||
|
<Button variant="light" onClick={close}>Batal</Button>
|
||||||
|
<Button variant="filled" color="red" onClick={close}>Tolak</Button>
|
||||||
|
</Group>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
:
|
||||||
|
(
|
||||||
|
<>
|
||||||
|
<Text>Anda yakin ingin menerima pengaduan ini?</Text>
|
||||||
|
<Group justify="center" grow>
|
||||||
|
<Button variant="light" onClick={close}>Batal</Button>
|
||||||
|
<Button variant="filled" color="green" onClick={close}>Terima</Button>
|
||||||
|
</Group>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
</Stack>
|
||||||
|
</Modal>
|
||||||
|
|
||||||
<Card
|
<Card
|
||||||
radius="md"
|
radius="md"
|
||||||
p="lg"
|
p="lg"
|
||||||
@@ -157,9 +194,16 @@ function DetailDataPengaduan() {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
|
<Grid.Col span={12}>
|
||||||
|
<Group justify="center" grow>
|
||||||
|
<Button variant="light" onClick={() => { setCatModal('tolak'); open() }}>Tolak</Button>
|
||||||
|
<Button variant="filled" onClick={() => { setCatModal('terima'); open() }}>Terima</Button>
|
||||||
|
</Group>
|
||||||
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Card>
|
</Card>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user