upd: notif warga

Deskripsi:
- tolak pengaduan
- terima pengaduan
- kerjakan pengaduan
- pengaduan selesai

NO Issues
This commit is contained in:
2026-01-02 14:52:00 +08:00
parent 3944e1ee82
commit 487395bdb3
17 changed files with 958 additions and 766 deletions

View File

@@ -31,7 +31,7 @@ import {
IconInfoCircle,
IconNotes,
IconPhone,
IconUpload
IconUpload,
} from "@tabler/icons-react";
import dayjs from "dayjs";
import "dayjs/locale/id";
@@ -268,9 +268,7 @@ export default function FormSurat() {
overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}
>
<Stack gap="sm">
<Text>
Apakah anda yakin ingin mengirim pengajuan surat ini?
</Text>
<Text>Apakah anda yakin ingin mengirim pengajuan surat ini?</Text>
<Group justify="center" grow>
<Button variant="light" onClick={close}>
Tidak
@@ -298,8 +296,7 @@ export default function FormSurat() {
}}
category="create"
/>
)
:
) : (
<Box>
<Stack gap="lg">
<Group justify="space-between" align="center">
@@ -348,7 +345,6 @@ export default function FormSurat() {
</Grid>
</FormSection>
{/* Kontak Section */}
<FormSection
title="Kontak"
@@ -385,63 +381,84 @@ export default function FormSurat() {
</Grid>
</FormSection>
{jenisSuratFix.id != "" && dataSurat && dataSurat.dataPelengkap && (
<>
<FormSection
title="Data Yang Diperlukan"
description="Data yang diperlukan untuk mengajukan surat"
icon={<IconNotes size={16} />}
>
<Grid>
{dataSurat.dataPelengkap.map((item: any, index: number) => (
<Grid.Col span={6} key={index}>
{
item.type == "enum"
?
<Select
label={
<FieldLabel label={item.name} hint={item.desc} />
}
data={item.options ?? []}
placeholder={item.name}
onChange={(e) => {
validationForm({
key: "dataPelengkap",
value: { key: item.key, value: e }
})
}}
value={formSurat.dataPelengkap.find((n: any) => n.key == item.key)?.value}
/>
: item.type == "date"
?
{jenisSuratFix.id != "" &&
dataSurat &&
dataSurat.dataPelengkap && (
<>
<FormSection
title="Data Yang Diperlukan"
description="Data yang diperlukan untuk mengajukan surat"
icon={<IconNotes size={16} />}
>
<Grid>
{dataSurat.dataPelengkap.map(
(item: any, index: number) => (
<Grid.Col span={6} key={index}>
{item.type == "enum" ? (
<Select
label={
<FieldLabel
label={item.name}
hint={item.desc}
/>
}
data={item.options ?? []}
placeholder={item.name}
onChange={(e) => {
validationForm({
key: "dataPelengkap",
value: { key: item.key, value: e },
});
}}
value={
formSurat.dataPelengkap.find(
(n: any) => n.key == item.key,
)?.value
}
/>
) : item.type == "date" ? (
<DateInput
locale="id"
valueFormat="DD MMMM YYYY"
label={
<FieldLabel label={item.name} hint={item.desc} />
<FieldLabel
label={item.name}
hint={item.desc}
/>
}
placeholder={item.name}
onChange={(e) => {
const formatted = e
? dayjs(e).locale("id").format("DD MMMM YYYY")
? dayjs(e)
.locale("id")
.format("DD MMMM YYYY")
: "";
validationForm({
key: "dataPelengkap",
value: { key: item.key, value: formatted },
})
value: {
key: item.key,
value: formatted,
},
});
}}
/>
:
) : (
<TextInput
type={item.type}
label={
<FieldLabel label={item.name} hint={item.desc} />
<FieldLabel
label={item.name}
hint={item.desc}
/>
}
placeholder={item.name}
onChange={(e) =>
validationForm({
key: "dataPelengkap",
value: { key: item.key, value: e.target.value },
value: {
key: item.key,
value: e.target.value,
},
})
}
value={
@@ -450,52 +467,53 @@ export default function FormSurat() {
)?.value
}
/>
}
)}
</Grid.Col>
),
)}
</Grid>
</FormSection>
</Grid.Col>
))}
</Grid>
</FormSection>
<FormSection
title="Syarat Dokumen"
description="Syarat dokumen yang diperlukan"
icon={<IconFiles size={16} />}
>
<Grid>
{dataSurat.syaratDokumen.map(
(item: any, index: number) => (
<Grid.Col span={6} key={index}>
<FileInputWrapper
label={item.desc}
placeholder={"Upload file "}
accept="image/*,application/pdf"
onChange={(file) =>
validationForm({
key: "syaratDokumen",
value: { key: item.key, value: file },
})
}
name={item.name}
/>
</Grid.Col>
),
)}
</Grid>
</FormSection>
<FormSection
title="Syarat Dokumen"
description="Syarat dokumen yang diperlukan"
icon={<IconFiles size={16} />}
>
<Grid>
{dataSurat.syaratDokumen.map((item: any, index: number) => (
<Grid.Col span={6} key={index}>
<FileInputWrapper
label={item.desc}
placeholder={"Upload file "}
accept="image/*,application/pdf"
onChange={(file) =>
validationForm({
key: "syaratDokumen",
value: { key: item.key, value: file },
})
}
name={item.name}
/>
</Grid.Col>
))}
</Grid>
</FormSection>
{/* Actions */}
<Group justify="right" mt="md">
{/* <Button variant="default" onClick={() => { }}>
{/* Actions */}
<Group justify="right" mt="md">
{/* <Button variant="default" onClick={() => { }}>
Reset
</Button> */}
<Button onClick={onChecking}>Kirim</Button>
</Group>
</>
)}
<Button onClick={onChecking}>Kirim</Button>
</Group>
</>
)}
</Stack>
</Stack>
</Box>
}
)}
</Container>
);
}