Files
hipmi-mobile/screens/Profile/menuDrawerSection.tsx
Bagasbanuna02 48c34aa26c Admin
Add:
- app/(application)/(admin)/

## No Issue
2025-08-05 12:11:25 +08:00

41 lines
1.1 KiB
TypeScript

import { IMenuDrawerItem } from "@/components/_Interface/types";
import MenuDrawerDynamicGrid from "@/components/Drawer/MenuDrawerDynamicGird";
import { router } from "expo-router";
export default function Profile_MenuDrawerSection({
drawerItems,
setShowLogoutAlert,
setIsDrawerOpen,
}: {
drawerItems: IMenuDrawerItem[];
setShowLogoutAlert: (value: boolean) => void;
setIsDrawerOpen: (value: boolean) => void;
}) {
const handlePress = (item: IMenuDrawerItem) => {
if (item.label === "Keluar") {
// console.log("Logout clicked");
setShowLogoutAlert(true);
} else {
console.log("PATH >> ", item.path);
router.push(item.path as any);
}
setIsDrawerOpen(false);
};
return (
<>
{/* Menu Items */}
<MenuDrawerDynamicGrid
data={drawerItems.map((item) => ({
icon: item.icon,
label: item.label,
path: item.path as any,
color: item.color,
}))}
columns={4} // Ubah ke 2 jika ingin 2 kolom per baris
onPressItem={(item) => handlePress(item as any)}
/>
</>
);
}