Files
web/components/Maps/Markers/Poi/index.tsx
2024-09-18 15:22:31 +02:00

28 lines
731 B
TypeScript

import { getIconByIconName } from "@/components/Icons/get-icon-by-icon-name"
import { getCategoryIconName } from "../utils"
import { poiVariants } from "./variants"
import { PoiMarkerProps } from "@/types/components/maps/poiMarker"
export default function PoiMarker({
category,
skipBackground,
size = 16,
className = "",
}: PoiMarkerProps) {
const iconName = getCategoryIconName(category)
const Icon = iconName ? getIconByIconName(iconName) : null
const classNames = poiVariants({ category, skipBackground, className })
return Icon ? (
<span className={classNames}>
<Icon
color={skipBackground ? "grey80" : "white"}
width={size}
height={size}
/>
</span>
) : null
}