mirror of
https://github.com/twentyhq/twenty
synced 2026-05-03 03:17:25 +00:00
* Migrate standard objects * Add migrations * fix relation * fix: register RelationMetadataType enum * fix: correctly fix null relation --------- Co-authored-by: corentin <corentin@twenty.com> Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
34 lines
1 KiB
TypeScript
34 lines
1 KiB
TypeScript
import { useNavigate } from 'react-router-dom';
|
|
|
|
import { Icon123 } from '@/ui/input/constants/icons';
|
|
import { useLazyLoadIcons } from '@/ui/input/hooks/useLazyLoadIcons';
|
|
import NavItem from '@/ui/navigation/navbar/components/NavItem';
|
|
|
|
import { useFindManyObjectMetadataItems } from '../hooks/useFindManyObjectMetadataItems';
|
|
|
|
export const ObjectMetadataNavItems = () => {
|
|
const { objectMetadataItems } = useFindManyObjectMetadataItems();
|
|
|
|
const navigate = useNavigate();
|
|
const { icons } = useLazyLoadIcons();
|
|
|
|
return (
|
|
<>
|
|
{objectMetadataItems.map((objectMetadataItem) => {
|
|
return (
|
|
<NavItem
|
|
key={objectMetadataItem.id}
|
|
label={objectMetadataItem.labelPlural}
|
|
to={`/objects/${objectMetadataItem.namePlural}`}
|
|
Icon={
|
|
objectMetadataItem.icon ? icons[objectMetadataItem.icon] : Icon123
|
|
}
|
|
onClick={() => {
|
|
navigate(`/objects/${objectMetadataItem.namePlural}`);
|
|
}}
|
|
/>
|
|
);
|
|
})}
|
|
</>
|
|
);
|
|
};
|