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, useRemoveAnnouncement } from '../hooks/api' import { Announcement } from '../api/announcement/types' import { iconItem } from '../utils/markerIcons' import { CSSProperties } from 'react' import { useId } from '../hooks' type AnnouncementDetailsProps = { close: () => void, announcement: Announcement } const styles = { container: { display: 'flex', alignItems: 'center', justifyContent: 'center', } as CSSProperties, map: { width: '100%', minHeight: 300, } as CSSProperties, } function AnnouncementDetails({ close, announcement: { id, name, category, bestBy, description, lat, lng, address, metro, bookedBy, userId } }: AnnouncementDetailsProps) { const { handleBook, bookButton } = useBook() const { handleRemove, removeButton } = useRemoveAnnouncement(close) const myId = useId() return (
Подробнее

{name}

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

{description}

{address}
{metro}

Забронировали {bookedBy} чел.

{(myId === userId) ? (
) } export default AnnouncementDetails