one more cluster & button fix
This commit is contained in:
@@ -11,6 +11,7 @@ import { getConnectedAircraftsAPI } from "querys/aircrafts";
|
||||
import { getMissionsAPI } from "querys/missions";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useMap } from "react-leaflet";
|
||||
import { HPGValidationRequired } from "helpers/hpgValidationRequired";
|
||||
|
||||
const PopupContent = ({
|
||||
aircrafts,
|
||||
@@ -56,15 +57,13 @@ const PopupContent = ({
|
||||
}}
|
||||
/>
|
||||
{missions.map((mission) => {
|
||||
const markerColor =
|
||||
mission.hpgValidationState ===
|
||||
(HpgValidationState.POSITION_AMANDED ||
|
||||
HpgValidationState.INVALID ||
|
||||
HpgValidationState.HPG_DISCONNECT ||
|
||||
HpgValidationState.HPG_BUSY ||
|
||||
HpgValidationState.HPG_INVALID_MISSION)
|
||||
? MISSION_STATUS_COLORS["attention"]
|
||||
: MISSION_STATUS_COLORS[mission.state];
|
||||
const needsAction =
|
||||
HPGValidationRequired(mission.missionStationIds, aircrafts, mission.hpgMissionString) &&
|
||||
mission.hpgValidationState !== "VALID";
|
||||
|
||||
const markerColor = needsAction
|
||||
? MISSION_STATUS_COLORS["attention"]
|
||||
: MISSION_STATUS_COLORS[mission.state];
|
||||
return (
|
||||
<div
|
||||
key={mission.id}
|
||||
|
||||
@@ -177,16 +177,17 @@ const Einsatzdetails = ({
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2 w-full">
|
||||
{(!hpgNeedsAttention || ignoreHpg) && (
|
||||
<button
|
||||
className="btn btn-sm btn-info btn-outline flex-3"
|
||||
onClick={() => sendAlertMutation.mutate(mission.id)}
|
||||
>
|
||||
<span className="flex items-center gap-2">
|
||||
<BellRing size={16} /> Alarmieren
|
||||
</span>
|
||||
</button>
|
||||
)}
|
||||
{(!hpgNeedsAttention || ignoreHpg) &&
|
||||
mission.hpgValidationState !== HpgValidationState.POSITION_AMANDED && (
|
||||
<button
|
||||
className="btn btn-sm btn-info btn-outline flex-3"
|
||||
onClick={() => sendAlertMutation.mutate(mission.id)}
|
||||
>
|
||||
<span className="flex items-center gap-2">
|
||||
<BellRing size={16} /> Alarmieren
|
||||
</span>
|
||||
</button>
|
||||
)}
|
||||
{!ignoreHpg &&
|
||||
hpgNeedsAttention &&
|
||||
mission.hpgValidationState !== HpgValidationState.POSITION_AMANDED && (
|
||||
|
||||
Reference in New Issue
Block a user