import { RefAttributes } from 'react';
import { Marker, MarkerProps } from 'react-leaflet';
import { icon, Marker as LeafletMarker } from 'leaflet';

import defaultIcon from '../location-picker/defaultIcon';

export type StaticMarkerProps = MarkerProps & RefAttributes<LeafletMarker<any>>;

const StaticMarker = (props: StaticMarkerProps) => {
	return (
		<Marker
			icon={icon({
				iconUrl: defaultIcon,
				iconAnchor: [16, 40],
				iconSize: [32, 40]
			})}
			{...props}
		/>
	);
};

export default StaticMarker;
