//SideMenu.tsx import React from 'react'; import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import { Category } from "../types/Category"; export type MenuItem = { label: string; key: Category; }; type SideMenuProps = { menuItems: MenuItem[]; selected: Category; onSelect: (key: Category) => void; onLogout?: () => void; }; export function SideMenu({ menuItems, selected, onSelect, onLogout }: SideMenuProps) { return ( {menuItems.map(item => ( onSelect(item.key)}> {item.label} ))} {onLogout && ( Logout )} ); } const styles = StyleSheet.create({ sideMenu: { backgroundColor: '#333', paddingTop: 40, paddingHorizontal: 16, }, menuItem: { paddingVertical: 16, borderRadius: 4, marginBottom: 8, }, menuItemSelected: { backgroundColor: '#555', }, menuText: { color: '#fff', fontSize: 18, textAlign: 'center', }, logoutButton: { marginTop: 'auto', backgroundColor: '#111', paddingVertical: 16, borderRadius: 4, alignItems: 'center', justifyContent: 'center', flexDirection: 'column', }, });