diff --git a/apps/dispatch/app/(app)/dispatch/_components/StationSelect.tsx b/apps/dispatch/app/(app)/dispatch/_components/StationSelect.tsx index 73dbab03..6d1e11a5 100644 --- a/apps/dispatch/app/(app)/dispatch/_components/StationSelect.tsx +++ b/apps/dispatch/app/(app)/dispatch/_components/StationSelect.tsx @@ -127,8 +127,10 @@ export function StationsSelect({ placeholder={ isMulti ? "Wähle ein oder mehrere Rettungsmittel aus" : "Wähle ein Rettungsmittel aus" } + formatOptionLabel={(option: any) => option.component} options={stationsOptions.map((s) => ({ - label: ( + label: s.label, + component: (
= { "&:hover": { borderColor: "color-mix(in oklab, var(--color-base-content) 20%, #0000);", }, + color: "var(--color-primary-content)", }), option: (provided, state) => ({ ...provided, @@ -34,12 +35,24 @@ const customStyles: StylesConfig = { ...provided, backgroundColor: "var(--color-base-300)", }), + input: (provided) => ({ + ...provided, + color: "var(--color-primary-content)", + }), menu: (provided) => ({ ...provided, backgroundColor: "var(--color-base-100)", borderRadius: "0.5rem", zIndex: 9999, }), + menuPortal: (provided) => ({ + ...provided, + maxHeight: "230px", + }), + menuList: (provided) => ({ + ...provided, + maxHeight: "230px", + }), }; interface SelectProps extends Omit { diff --git a/apps/dispatch/app/_components/map/_components/AircraftMarkerTabs.tsx b/apps/dispatch/app/_components/map/_components/AircraftMarkerTabs.tsx index 8939a3c7..1206f900 100644 --- a/apps/dispatch/app/_components/map/_components/AircraftMarkerTabs.tsx +++ b/apps/dispatch/app/_components/map/_components/AircraftMarkerTabs.tsx @@ -385,6 +385,31 @@ const SDSTab = ({ return () => clearInterval(interval); }); + const sendSds = () => { + sendSdsMutation + .mutateAsync({ + missionId: mission?.id, + sdsMessage: { + type: "sds-log", + auto: false, + timeStamp: new Date().toISOString(), + data: { + stationId: aircraft.Station.id, + station: aircraft.Station, + message: note, + user: getPublicUser(session.data!.user, { + ignorePrivacy: true, + }), + }, + }, + }) + .then(() => { + toast.success("SDS-Nachricht gesendet"); + setIsChatOpen(false); + setNote(""); + }); + }; + return (
{dispatcherConnected && ( @@ -409,32 +434,16 @@ const SDSTab = ({ value={note} onChange={(e) => setNote(e.target.value)} ref={textInputRef} + onKeyDown={(e) => { + if (e.key === "Enter" && note.trim()) { + sendSds(); + } + }} />