feat(theme): Allow custom icon in DocCard component

This commit is contained in:
Johannes Liermann 2025-12-02 12:30:25 +01:00
parent c6c0f636a8
commit 75e9502483

View File

@ -113,7 +113,9 @@ function CardCategory({item}: {item: PropSidebarItemCategory}): ReactNode {
}
function CardLink({item}: {item: PropSidebarItemLink}): ReactNode {
const icon = isInternalUrl(item.href) ? '📄️' : '🔗';
const defaultIcon = isInternalUrl(item.href) ? '📄' : '🔗';
const customIcon = item.icon && item.icon !== '';
const icon = customIcon ? item.icon : defaultIcon;
const doc = useDocById(item.docId ?? undefined);
return (
<CardLayout