The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
import { type BreadcrumbProps } from '@/ui/navigation/bread-crumb/types/BreadcrumbProps';
import { isNonEmptyString } from '@sniptt/guards';
import { Link } from 'react-router-dom';
import { type BreadcrumbItem } from 'twenty-ui/primitives/navigation';
export const getBreadcrumbItems = (
links: BreadcrumbProps['links'],
): BreadcrumbItem[] =>
links.map(({ children, href }) => ({
children,
href: isNonEmptyString(href) ? href : undefined,
render: isNonEmptyString(href) ? <Link to={href} /> : undefined,
}));