- Migrate admin/investment/[id]/[status]/index.tsx to OS_Wrapper (detail with pull-to-refresh) - Migrate admin/investment/[id]/[status]/transaction-detail.tsx to OS_Wrapper (transaction detail with footer) - Migrate admin/investment/[id]/reject-input.tsx to OS_Wrapper with enableKeyboardHandling - Migrate admin/investment/index.tsx to OS_Wrapper (dashboard) - Migrate ScreenInvestmentListOfInvestor.tsx to OS_Wrapper - Migrate ScreenInvestmentStatus.tsx to OS_Wrapper - Migrate admin/dashboard.tsx to OS_Wrapper - Migrate admin/maps.tsx to OS_Wrapper - Fix TASK-005 documentation: reorder Admin Phases 1-10, update tracking table - Mark Admin Phase 3 (Donation) as Complete (12 files verified) - Add Admin Phase 10 (Dashboard & Maps) documentation - Update grand total: 178/~184 files (~97% complete) Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
60 lines
1.6 KiB
TypeScript
60 lines
1.6 KiB
TypeScript
import { StackCustom, TextCustom } from "@/components";
|
|
import OS_Wrapper from "@/components/_ShareComponent/OS_Wrapper";
|
|
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
|
import { MainColor } from "@/constants/color-palet";
|
|
import { apiAdminMainDashboardGetAll } from "@/service/api-admin/api-admin-main-dashboard";
|
|
import { Ionicons } from "@expo/vector-icons";
|
|
import { useEffect, useState } from "react";
|
|
|
|
export default function AdminDashboard() {
|
|
const [countUser, setCountUser] = useState(0);
|
|
const [countPortofolio, setCountPortofolio] = useState(0);
|
|
|
|
useEffect(() => {
|
|
onLoadData();
|
|
}, []);
|
|
|
|
const onLoadData = async () => {
|
|
try {
|
|
const response = await apiAdminMainDashboardGetAll();
|
|
|
|
if (response.success) {
|
|
setCountUser(response.data.user);
|
|
setCountPortofolio(response.data.portofolio);
|
|
}
|
|
} catch (error) {
|
|
console.log("[ERROR LOAD DATA]", error);
|
|
}
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<OS_Wrapper>
|
|
<StackCustom>
|
|
<TextCustom bold size={30}>
|
|
Main Dashboard
|
|
</TextCustom>
|
|
{listData(countUser, countPortofolio).map((item, i) => (
|
|
<AdminComp_BoxDashboard key={i} item={item} />
|
|
))}
|
|
</StackCustom>
|
|
</OS_Wrapper>
|
|
</>
|
|
);
|
|
}
|
|
|
|
const listData = (countUser: number, countPortofolio: number) => [
|
|
{
|
|
label: "User",
|
|
value: countUser,
|
|
icon: <Ionicons name="people" size={30} color={MainColor.yellow} />,
|
|
},
|
|
{
|
|
label: "Portofolio",
|
|
value: countPortofolio,
|
|
icon: (
|
|
<Ionicons name="id-card-outline" size={30} color={MainColor.yellow} />
|
|
),
|
|
},
|
|
];
|