import { Group, Stack } from '@mantine/core'; import { useMemo } from 'react'; import { useConfigContext } from '../../../config/provider'; import { ServiceTile } from '../Tiles/Service/Service'; import { DashboardSidebar } from '../Wrappers/Sidebar/Sidebar'; export const DashboardView = () => { const wrappers = useWrapperItems(); return ( {/**/} {wrappers.map( (item) => item.type === 'category' ? 'category' // : 'wrapper' // )} {/**/} ); }; const useWrapperItems = () => { const { config } = useConfigContext(); return useMemo( () => config ? [ ...config.categories.map((c) => ({ ...c, type: 'category' })), ...config.wrappers.map((w) => ({ ...w, type: 'wrapper' })), ].sort((a, b) => a.position - b.position) : [], [config?.categories, config?.wrappers] ); };