File size: 623 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import { GuideCollection } from "@/.velite"
import {
LuCode,
LuGlobe,
LuLayoutGrid,
LuPaintbrush,
LuSparkle,
LuWrench,
} from "react-icons/lu"
const iconMap: Record<GuideCollection["id"], React.ElementType> = {
components: LuLayoutGrid,
"next-js": LuCode,
recipe: LuSparkle,
snippets: LuCode,
styling: LuPaintbrush,
theming: LuWrench,
overview: LuGlobe,
}
interface CollectionIconProps {
value: GuideCollection["id"] | null
}
export const CollectionIcon = (props: CollectionIconProps) => {
const Icon = props.value ? iconMap[props.value] : null
if (!Icon) return null
return <Icon />
}
|