import React from "react"; import { Text } from "@local-logic/core/ui"; import { typeguardUtils } from "@local-logic/core/utils"; import { RootProps } from "./types"; import * as S from "./styles"; const Root = ({ options: { data, type, activePOI, hoveredPOI }, onChange, }: RootProps) => ( {data?.map((poi, i) => ( onChange && onChange({ type: "poi-click", data: poi })} onMouseOver={() => onChange && onChange({ type: "poi-hover", data: poi }) } onMouseLeave={() => onChange && onChange({ type: "poi-hover", data: undefined }) } > {poi.name} {typeguardUtils.poi.isSchool(poi, type) ? ( {poi.school_attributes?.types?.map((t, i2) => ( ))} ) : ( {poi.routes?.map((route, i2) => ( ))} )} ))} ); export { Root };