feat: AlarmIcon nur bei GisStationsStatusDistrict Attribute Alarm :1
This commit is contained in:
@@ -139,6 +139,13 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
const { data: gisLinesStatusData, status: statusGisLinesStatus } = useSelector(
|
||||
selectGisLinesStatusFromWebservice
|
||||
);
|
||||
|
||||
// Alarm Status aus GisStationsStatusDistrict
|
||||
const gisStationsStatusDistrict = useSelector(state => state.gisStationsStatusDistrict.data);
|
||||
// Unterstützt sowohl Array-Shape (Statis[]) als auch Objekt mit Statis-Array
|
||||
const hasActiveAlarm = Array.isArray(gisStationsStatusDistrict)
|
||||
? gisStationsStatusDistrict.some(item => item?.Alarm === 1)
|
||||
: gisStationsStatusDistrict?.Statis?.some(item => item?.Alarm === 1) || false;
|
||||
const poiIconsData = useSelector(selectPoiIconsData);
|
||||
const poiIconsStatus = useSelector(selectPoiIconsStatus);
|
||||
const poiTypData = useSelector(selectPoiTypData);
|
||||
@@ -1137,15 +1144,17 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
<div id="map" ref={mapRef} className="z-0" style={{ height: "100vh", width: "100vw" }}></div>
|
||||
{/* Top-right controls: layers, info, expand, edit, and base map stack */}
|
||||
<div className="absolute top-3 right-3 z-50 pointer-events-auto flex items-center gap-2">
|
||||
{/* Alarm-Icon (mdi) */}
|
||||
<button
|
||||
onClick={() => {}}
|
||||
aria-label="Alarm"
|
||||
className="rounded-full bg-white/90 hover:bg-white shadow p-1"
|
||||
title="Alarm"
|
||||
>
|
||||
<AlarmIcon className="h-8 w-8" />
|
||||
</button>
|
||||
{/* Alarm-Icon - nur anzeigen wenn Alarm aktiv */}
|
||||
{hasActiveAlarm && (
|
||||
<button
|
||||
onClick={() => {}}
|
||||
aria-label="Alarm aktiv"
|
||||
className="rounded-full bg-white/90 hover:bg-white shadow p-1"
|
||||
title="Alarm aktiv"
|
||||
>
|
||||
<AlarmIcon className="h-8 w-8 animate-pulse text-red-500" />
|
||||
</button>
|
||||
)}
|
||||
{/* Marker-Icon (line-md) */}
|
||||
<button
|
||||
onClick={() => {}}
|
||||
|
||||
Reference in New Issue
Block a user