import { ReactElement } from 'react'; import { Center, Flex, HStack, Text } from '@chakra-ui/react'; import { LuCrown, LuDisc3, LuEar, LuFileAudio } from 'react-icons/lu'; import { MdGroup } from 'react-icons/md'; import { useNavigate } from 'react-router-dom'; import { PageLayout } from '@/components/Layout/PageLayout'; import { TopBar } from '@/components/TopBar/TopBar'; import { useColorModeValue } from '@/components/ui/color-mode'; type HomeListType = { id: number; name: string; icon: ReactElement; to: string; }; const homeList: HomeListType[] = [ { id: 1, name: 'Genders', icon: , to: 'gender', }, { id: 2, name: 'Artists', icon: , to: 'artist', }, { id: 3, name: 'Albums', icon: , to: 'album', }, { id: 4, name: 'Tracks', icon: , to: 'track', }, { id: 5, name: 'Playlists', icon: , to: 'playlists', }, ]; export const HomePage = () => { const navigate = useNavigate(); const onSelectItem = (data: HomeListType) => { navigate(data.to); }; return ( <> {homeList.map((data) => ( onSelectItem(data)} >
{data.icon}
{data.name}
))}
); };