Letzte TDR-Messung Button erstellen

This commit is contained in:
Ismail Ali
2025-03-24 20:18:23 +01:00
parent 24306c3df8
commit 4d97252556
2 changed files with 36 additions and 23 deletions

View File

@@ -31,31 +31,44 @@ const TDRChartActionBar: React.FC = () => {
if (!data) return; if (!data) return;
dispatch(setTDRChartDataById({ id, data })); dispatch(setTDRChartDataById({ id, data }));
dispatch(setSelectedTDRId(id)); // 👉 wichtig! dispatch(setSelectedTDRId(id));
};
const handleReset = () => {
setSelectedId(null);
dispatch(setSelectedTDRId(null));
}; };
return ( return (
<div className="flex flex-wrap justify-end items-center p-2 bg-gray-100 rounded-lg space-x-2"> <div className="flex justify-between items-center p-2 bg-gray-100 rounded-lg space-x-4">
{idsForSlot.length > 0 && ( {/* 🔵 Linke Seite: Reset-Button */}
<> <button
<label htmlFor="tdrIdSelect" className="text-sm font-semibold"> className="border border-gray-300 bg-white rounded px-3 py-1 text-sm hover:bg-gray-200"
Messung ID onClick={handleReset}
</label> >
<select Letzte Messung
id="tdrIdSelect" </button>
value={selectedId ?? ""}
onChange={handleSelectChange} {/* 🔵 Rechte Seite: Dropdown */}
className="border rounded px-2 py-1 text-sm" <div className="flex items-center space-x-2">
> <label htmlFor="tdrIdSelect" className="text-sm font-semibold">
<option value="">-- Wähle Messung --</option> Messung ID
{idsForSlot.map((entry) => ( </label>
<option key={entry.id} value={entry.id}> <select
ID {entry.id} {entry.t} id="tdrIdSelect"
</option> value={selectedId ?? ""}
))} onChange={handleSelectChange}
</select> className="border rounded px-2 py-1 text-sm"
</> disabled={idsForSlot.length === 0}
)} >
<option value="">-- Wähle Messung --</option>
{idsForSlot.map((entry) => (
<option key={entry.id} value={entry.id}>
ID {entry.id} {entry.t}
</option>
))}
</select>
</div>
</div> </div>
); );
}; };

View File

@@ -6,5 +6,5 @@
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen). 2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
*/ */
const webVersion = "1.6.153"; const webVersion = "1.6.154";
export default webVersion; export default webVersion;