mirror of
https://github.com/twentyhq/twenty
synced 2026-04-21 21:47:38 +00:00
* Some cleaning * Fix seeds * Fix all sign in, sign up flow and apiKey optimistic rendering * Fix
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { useNavigate } from 'react-router-dom';
|
|
|
|
import { useObjectMetadataItemForSettings } from '@/object-metadata/hooks/useObjectMetadataItemForSettings';
|
|
import { Icon123 } from '@/ui/input/constants/icons';
|
|
import { useLazyLoadIcons } from '@/ui/input/hooks/useLazyLoadIcons';
|
|
import NavItem from '@/ui/navigation/navbar/components/NavItem';
|
|
|
|
export const ObjectMetadataNavItems = () => {
|
|
const { activeObjectMetadataItems } = useObjectMetadataItemForSettings();
|
|
const navigate = useNavigate();
|
|
const { icons } = useLazyLoadIcons();
|
|
|
|
return (
|
|
<>
|
|
{activeObjectMetadataItems.map((objectMetadataItem) => {
|
|
if (objectMetadataItem.nameSingular === 'opportunity') return null;
|
|
return (
|
|
<NavItem
|
|
key={objectMetadataItem.id}
|
|
label={objectMetadataItem.labelPlural}
|
|
to={`/objects/${objectMetadataItem.namePlural}`}
|
|
Icon={
|
|
objectMetadataItem.icon ? icons[objectMetadataItem.icon] : Icon123
|
|
}
|
|
onClick={() => {
|
|
navigate(`/objects/${objectMetadataItem.namePlural}`);
|
|
}}
|
|
/>
|
|
);
|
|
})}
|
|
</>
|
|
);
|
|
};
|