Admin – Donation Pages - app/(application)/admin/donation/[id]/detail-disbursement-of-funds.tsx - app/(application)/admin/donation/[id]/list-disbursement-of-funds.tsx - app/(application)/admin/donation/[id]/list-of-donatur.tsx - app/(application)/admin/donation/[status]/status.tsx - app/(application)/admin/donation/category-update.tsx - app/(application)/admin/donation/category.tsx Admin Services - service/api-admin/api-admin-donation.ts - service/api-admin/api-master-admin.ts Admin Screens (Updated) - screens/Admin/Voting/ScreenEventTypeOfEvent.tsx Docs - docs/prompt-for-qwen-code.md New Donation Components - screens/Admin/Donation/BoxDonationCategory.tsx - screens/Admin/Donation/BoxDonationListDisbursementOfFunds.tsx - screens/Admin/Donation/BoxDonationListOfDonatur.tsx - screens/Admin/Donation/BoxDonationStatus.tsx New Donation Screens - screens/Admin/Donation/ScreenDonationCategory.tsx - screens/Admin/Donation/ScreenDonationListDisbursementOfFunds.tsx - screens/Admin/Donation/ScreenDonationListOfDonatur.tsx - screens/Admin/Donation/ScreenDonationStatus.tsx ### No Issue"
90 lines
2.3 KiB
TypeScript
90 lines
2.3 KiB
TypeScript
/* eslint-disable react-hooks/exhaustive-deps */
|
|
import {
|
|
BaseBox,
|
|
ButtonCustom,
|
|
StackCustom,
|
|
TextCustom,
|
|
ViewWrapper,
|
|
} from "@/components";
|
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
|
import { GridSpan_4_8 } from "@/components/_ShareComponent/GridSpan_4_8";
|
|
import { apiAdminDonationDisbursementOfFundsListById } from "@/service/api-admin/api-admin-donation";
|
|
import { dateTimeView } from "@/utils/dateTimeView";
|
|
import { formatCurrencyDisplay } from "@/utils/formatCurrencyDisplay";
|
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
|
import React, { useCallback } from "react";
|
|
|
|
export default function AdminDonationDetailDisbursementOfFunds() {
|
|
const { id } = useLocalSearchParams();
|
|
const [data, setData] = React.useState<any | null>(null);
|
|
|
|
useFocusEffect(
|
|
useCallback(() => {
|
|
onLoadData();
|
|
}, [id])
|
|
);
|
|
|
|
const onLoadData = async () => {
|
|
try {
|
|
const response = await apiAdminDonationDisbursementOfFundsListById({
|
|
id: id as string,
|
|
category: "get-one",
|
|
});
|
|
|
|
if (response.success) {
|
|
setData(response.data);
|
|
}
|
|
} catch (error) {
|
|
console.log("[ERROR]", error);
|
|
}
|
|
};
|
|
|
|
const listData = [
|
|
{
|
|
label: "Nominal",
|
|
value: `Rp ${data ? formatCurrencyDisplay(data?.nominalCair) : 0}`,
|
|
},
|
|
{
|
|
label: "Tanggal",
|
|
value: data ? dateTimeView({ date: data?.createdAt }) : "-",
|
|
},
|
|
{
|
|
label: "Judul",
|
|
value: data ? data?.title : "-",
|
|
},
|
|
{
|
|
label: "Deskripsi",
|
|
value: data ? data?.deskripsi : "-",
|
|
},
|
|
];
|
|
return (
|
|
<>
|
|
<ViewWrapper
|
|
headerComponent={
|
|
<AdminBackButtonAntTitle title="Detail Pencairan Dana" />
|
|
}
|
|
>
|
|
<BaseBox>
|
|
<StackCustom>
|
|
{listData?.map((item, index) => (
|
|
<GridSpan_4_8
|
|
key={index}
|
|
label={<TextCustom bold>{item.label}</TextCustom>}
|
|
value={<TextCustom>{item.value}</TextCustom>}
|
|
/>
|
|
))}
|
|
</StackCustom>
|
|
</BaseBox>
|
|
|
|
<ButtonCustom
|
|
onPress={() =>
|
|
router.push(`/(application)/(image)/preview-image/${data?.imageId}`)
|
|
}
|
|
>
|
|
Cek Bukti Transaksi
|
|
</ButtonCustom>
|
|
</ViewWrapper>
|
|
</>
|
|
);
|
|
}
|