28 lines
731 B
TypeScript
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
|
|
}
|