New Btn Layout for running Missions
This commit is contained in:
@@ -61,9 +61,36 @@ const Einsatzdetails = ({ mission }: { mission: Mission }) => {
|
|||||||
const { setMissionFormValues, setOpen } = usePannelStore((state) => state);
|
const { setMissionFormValues, setOpen } = usePannelStore((state) => state);
|
||||||
return (
|
return (
|
||||||
<div className="p-4 text-base-content">
|
<div className="p-4 text-base-content">
|
||||||
<h2 className="flex items-center gap-2 text-lg font-bold mb-3">
|
<div className="flex items-center justify-between mb-3">
|
||||||
<Flag /> Einsatzdetails
|
<h2 className="flex items-center gap-2 text-lg font-bold">
|
||||||
</h2>
|
<Flag /> Einsatzdetails
|
||||||
|
</h2>
|
||||||
|
{mission.state !== "draft" && (
|
||||||
|
<div
|
||||||
|
className="tooltip tooltip-primary tooltip-left font-semibold"
|
||||||
|
data-tip="Einsatzdaten übernehmen"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
className="btn btn-xs btn-primary btn-dash flex items-center gap-2"
|
||||||
|
onClick={() => {
|
||||||
|
setMissionFormValues({
|
||||||
|
...mission,
|
||||||
|
id: undefined,
|
||||||
|
hpgAmbulanceState: null,
|
||||||
|
hpgFireEngineState: null,
|
||||||
|
hpgPoliceState: null,
|
||||||
|
hpgLocationLat: undefined,
|
||||||
|
hpgLocationLng: undefined,
|
||||||
|
state: "draft",
|
||||||
|
});
|
||||||
|
setOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Repeat2 size={16} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<ul className="text-base-content font-semibold">
|
<ul className="text-base-content font-semibold">
|
||||||
<li className="flex items-center gap-2 mb-1">
|
<li className="flex items-center gap-2 mb-1">
|
||||||
<BellRing size={16} /> {mission.missionKeywordCategory}
|
<BellRing size={16} /> {mission.missionKeywordCategory}
|
||||||
@@ -90,46 +117,48 @@ const Einsatzdetails = ({ mission }: { mission: Mission }) => {
|
|||||||
<LocateFixed size={16} /> {mission.addressZip} {mission.addressCity}
|
<LocateFixed size={16} /> {mission.addressZip} {mission.addressCity}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="divider mt-0 mb-0" />
|
{mission.state === "draft" && (
|
||||||
<div className="flex items-center gap-2 w-full">
|
<div>
|
||||||
<button
|
<div className="divider mt-0 mb-0" />
|
||||||
className="btn btn-sm btn-info btn-outline flex-3"
|
<div className="flex items-center gap-2 w-full">
|
||||||
onClick={() => sendAlertMutation.mutate(mission.id)}
|
<button
|
||||||
>
|
className="btn btn-sm btn-info btn-outline flex-3"
|
||||||
<span className="flex items-center gap-2">
|
onClick={() => sendAlertMutation.mutate(mission.id)}
|
||||||
<BellRing size={16} /> Alarmieren
|
>
|
||||||
</span>
|
<span className="flex items-center gap-2">
|
||||||
</button>
|
<BellRing size={16} /> Alarmieren
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
className="btn btn-sm btn-primary btn-dash flex items-center gap-2"
|
className="btn btn-sm btn-primary btn-dash flex items-center gap-2"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setMissionFormValues({
|
setMissionFormValues({
|
||||||
...mission,
|
...mission,
|
||||||
id: undefined,
|
id: undefined,
|
||||||
hpgAmbulanceState: null,
|
hpgAmbulanceState: null,
|
||||||
hpgFireEngineState: null,
|
hpgFireEngineState: null,
|
||||||
hpgPoliceState: null,
|
hpgPoliceState: null,
|
||||||
hpgLocationLat: undefined,
|
hpgLocationLat: undefined,
|
||||||
hpgLocationLng: undefined,
|
hpgLocationLng: undefined,
|
||||||
state: "draft",
|
state: "draft",
|
||||||
});
|
});
|
||||||
setOpen(true);
|
setOpen(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Repeat2 size={18} /> Daten übernehmen
|
<Repeat2 size={18} /> Daten übernehmen
|
||||||
</button>
|
</button>
|
||||||
{mission.state === "draft" && (
|
<button
|
||||||
<button
|
className="btn btn-sm btn-error btn-outline"
|
||||||
className="btn btn-sm btn-error btn-outline"
|
onClick={() => {
|
||||||
onClick={() => {
|
deleteMissionMutation.mutate(mission.id);
|
||||||
deleteMissionMutation.mutate(mission.id);
|
}}
|
||||||
}}
|
>
|
||||||
>
|
<Trash size={18} />
|
||||||
<Trash size={18} />
|
</button>
|
||||||
</button>
|
</div>
|
||||||
)}
|
</div>
|
||||||
</div>
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user