Chuyển tới nội dung chính

AccidentMarkers

Map markers component for displaying accident locations with severity indicators.

📋 Overview

PropertyValue
Filesrc/components/AccidentMarkers.tsx
TypeReact Functional Component
AuthorUIP Team
Version1.0.0

🎯 Purpose

  • Display accident locations on the map
  • Color-coded severity indicators (critical, high, medium, low)
  • Clickable markers with popup details
  • Real-time updates for new accidents

🚀 Usage

import { AccidentMarkers } from '@/components/AccidentMarkers';

function MapComponent() {
return (
<MapContainer>
<AccidentMarkers
accidents={accidentList}
onMarkerClick={handleAccidentClick}
/>
</MapContainer>
);
}

📦 Props

PropTypeRequiredDefaultDescription
accidentsAccident[]Yes-List of accidents
onMarkerClick(accident: Accident) => voidNo-Click handler
showPopupbooleanNotrueShow popup on click
filterSeveritystring[]No[]Filter by severity

🎨 Severity Colors

SeverityColorIcon
Critical🔴 RedAlertCircle
High🟠 OrangeAlertTriangle
Medium🟡 YellowAlert
Low🟢 GreenInfo

See the complete components reference for all available components.