feat(icons/id): Add related icons

This commit is contained in:
Thomas Camlong
2025-04-24 20:38:09 +02:00
committed by Bjorn Lammers
parent f0e20c2b19
commit 64c49274da
7 changed files with 144 additions and 120 deletions

View File

@@ -0,0 +1,21 @@
import type { Icon } from "@/types/icons"
import { IconCard } from "./icon-card"
interface IconsGridProps {
filteredIcons: { name: string; data: Icon }[]
matchedAliases: Record<string, string>
}
export function IconsGrid({ filteredIcons, matchedAliases }: IconsGridProps) {
return (
<>
<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8 gap-4 mt-2">
{filteredIcons.slice(0, 120).map(({ name, data }) => (
<IconCard key={name} name={name} data={data} matchedAlias={matchedAliases[name] || null} />
))}
</div>
{filteredIcons.length > 120 && <p className="text-sm text-muted-foreground">And {filteredIcons.length - 120} more...</p>}
</>
)
}