Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function SectionHeading({
slotName,
slotProps,
children,
id,
pagePerSection,
depth,
...rest
}) {
const href = pagePerSection
? getUrl({ slug: id, id: rest.depth !== 1, takeHash: true })
: getUrl({ slug: id, anchor: true });
return (
}
id={id}
href={href}
depth={depth === 2 ? 1 : depth}
{...rest}
>
{children}
);
}
const mappedItems = items.map((item) => ({
...item,
href: item.href
? item.href
: getUrl({
name: item.name,
slug: item.slug,
anchor: !useRouterLinks,
hashPath: useRouterLinks ? hashPath : false,
id: useRouterLinks ? useHashId : false,
}),
}));
return ;