import { Modal, Button } from 'react-bootstrap' import { MapContainer, Marker, Popup, TileLayer } from 'react-leaflet' import LineDot from './LineDot' import { categoryNames } from '../assets/category' import { useBook } from '../hooks/api' import { Announcement } from '../api/announcement/types' import { iconItem } from '../utils/markerIcons' import { CSSProperties } from 'react' type AnnouncementDetailsProps = { close: () => void, announcement: Announcement } const styles = { container: { display: 'flex', alignItems: 'center', justifyContent: 'center', } as CSSProperties, } function AnnouncementDetails({ close, announcement: { id, name, category, bestBy, description, lat, lng, address, metro } }: AnnouncementDetailsProps) { const { handleBook, status: bookStatus } = useBook(id) return (
Подробнее

{name}

{categoryNames[category]} {/* dot */} Годен до {new Date(bestBy).toLocaleString('ru-RU')}

{description}

{address}
{metro}
) } export default AnnouncementDetails