Edit draft mission update, nachalarmieren
This commit is contained in:
@@ -17,7 +17,6 @@ import {
|
||||
Cross,
|
||||
House,
|
||||
Minimize2,
|
||||
Route,
|
||||
SmartphoneNfc,
|
||||
PencilLine,
|
||||
} from "lucide-react";
|
||||
@@ -33,12 +32,13 @@ import Einsatzdetails, {
|
||||
Rettungsmittel,
|
||||
} from "./_components/MissionMarkerTabs";
|
||||
|
||||
export const MISSION_STATUS_COLORS: Record<MissionState, string> = {
|
||||
draft: "#0092b8",
|
||||
running: "#155dfc",
|
||||
finished: "#155dfc",
|
||||
attention: "rgb(186,105,0)",
|
||||
};
|
||||
export const MISSION_STATUS_COLORS: Record<MissionState | "attention", string> =
|
||||
{
|
||||
draft: "#0092b8",
|
||||
running: "#155dfc",
|
||||
finished: "#155dfc",
|
||||
attention: "rgb(186,105,0)",
|
||||
};
|
||||
|
||||
export const MISSION_STATUS_TEXT_COLORS: Record<MissionState, string> = {
|
||||
draft: "#00d3f2",
|
||||
@@ -183,8 +183,10 @@ const MissionPopupContent = ({ mission }: { mission: Mission }) => {
|
||||
setMissionFormValues({
|
||||
...mission,
|
||||
state: "draft",
|
||||
hpgLocationLat: mission.hpgLocationLat ?? undefined,
|
||||
hpgLocationLng: mission.hpgLocationLng ?? undefined,
|
||||
});
|
||||
setEditingMission(true, mission.id);
|
||||
setEditingMission(true, String(mission.id));
|
||||
setOpen(true);
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
"use client";
|
||||
import React, { useState } from "react";
|
||||
import { FMS_STATUS_TEXT_COLORS } from "../AircraftMarker";
|
||||
/* import { Select } from "_components/Select";
|
||||
import { Station } from "@repo/db";
|
||||
import { getStations } from "dispatch/_components/pannel/action"; */
|
||||
import {
|
||||
Ban,
|
||||
BellRing,
|
||||
@@ -114,7 +117,13 @@ const Patientdetails = ({ mission }: { mission: Mission }) => {
|
||||
);
|
||||
};
|
||||
|
||||
const Rettungsmittel = () => {
|
||||
const Rettungsmittel = ({ mission }: { mission: Mission }) => {
|
||||
/* const [stations, setStations] = useState<Station[]>([]);
|
||||
useEffect(() => {
|
||||
getStations().then((data) => {
|
||||
setStations(data);
|
||||
});
|
||||
}, []); */
|
||||
// Mockup data
|
||||
const mockupData = [
|
||||
{ bosCallsign: "Christoph 31", FMSstatus: 2, min: 6 },
|
||||
@@ -150,6 +159,20 @@ const Rettungsmittel = () => {
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<div className="divider mt-0 mb-0" />
|
||||
<div className="flex items-center gap-2">
|
||||
{/* TODO: make it a small multiselect */}
|
||||
<select className="select select-sm select-primary select-bordered flex-1">
|
||||
<option value="1">Feuerwehr</option>
|
||||
<option value="2">RTW</option>
|
||||
<option value="3">Polizei</option>
|
||||
</select>
|
||||
<button className="btn btn-sm btn-primary btn-outline">
|
||||
<span className="text-base-content flex items-center gap-2">
|
||||
<BellRing size={16} /> Nachalarmieren
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -255,8 +278,8 @@ const FMSStatusHistory = ({ mission }: { mission: Mission }) => {
|
||||
color: FMS_STATUS_TEXT_COLORS[6],
|
||||
}}
|
||||
>
|
||||
{entry.data.user.firstname[0].toUpperCase()}
|
||||
{entry.data.user.lastname[0].toUpperCase()}
|
||||
{entry.data.user.firstname?.[0]?.toUpperCase() ?? "?"}
|
||||
{entry.data.user.lastname?.[0]?.toUpperCase() ?? "?"}
|
||||
</span>
|
||||
<span className="text-base-content">{entry.data.message}</span>
|
||||
</li>
|
||||
|
||||
@@ -300,7 +300,7 @@ export const MissionForm = () => {
|
||||
onClick={form.handleSubmit(
|
||||
async (mission: MissionOptionalDefaults) => {
|
||||
try {
|
||||
deleteMission(editingMissionId);
|
||||
deleteMission(Number(editingMissionId));
|
||||
const newMission = await createMission(mission);
|
||||
toast.success(
|
||||
`Einsatz ${newMission.id} erfolgreich aktualisiert`,
|
||||
|
||||
@@ -5,8 +5,7 @@ import { Rss, Trash2Icon } from "lucide-react";
|
||||
|
||||
export const Pannel = () => {
|
||||
const { setOpen, setMissionFormValues } = usePannelStore();
|
||||
const { isEditingMission, editingMissionId, setEditingMission } =
|
||||
usePannelStore();
|
||||
const { isEditingMission, setEditingMission } = usePannelStore();
|
||||
|
||||
return (
|
||||
<div className={cn("flex-1 max-w-[600px] z-9999999")}>
|
||||
|
||||
Reference in New Issue
Block a user