import { atom, useAtom } from 'jotai'; import react from 'react'; import Marker from './Marker'; import { geoPoint, TileKeyObject } from './types'; export interface CurrentLocationProperties { keyObject?: TileKeyObject; zoom?: number; } const initialLocation: geoPoint | null = null; export const locationAtom = atom(initialLocation); export const CurrentLocation: react.FC = ( props: CurrentLocationProperties ) => { const [location] = useAtom(locationAtom); return location !== null ? ( } keyObject={props.keyObject} zoom={props.zoom} /> ) : null; }; export default CurrentLocation;