import { Button, Modal } from 'react-bootstrap' import { MapContainer, TileLayer } from 'react-leaflet' import { CSSProperties, useState } from 'react' import { LatLng } from 'leaflet' import { useDispose, useTrashboxes } from '../hooks/api' import { UseFetchReturn, gotError, gotResponse } from '../hooks/useFetch' import TrashboxMarkers from './TrashboxMarkers' import { Category } from '../assets/category' import { Trashbox } from '../api/trashbox/types' type SelectDisposalTrashboxProps = { annId: number, category: Category, address: LatLng, closeRefresh: () => void, } type SelectedTrashbox = { index: number, category: string, } const styles = { map: { width: '100%', height: 400, } as CSSProperties, } function SelectDisposalTrashbox({ annId, category, address, closeRefresh }: SelectDisposalTrashboxProps) { const trashboxes = useTrashboxes(address, category) const [selectedTrashbox, setSelectedTrashbox] = useState({ index: -1, category: '' }) const { handleDispose, disposeButton } = useDispose(closeRefresh) return ( <>
{gotResponse(trashboxes) ? ( gotError(trashboxes) ? (

{trashboxes.error}

) : ( ) ) : (

Загрузка...

) }