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,13 +31,26 @@ 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
className="border border-gray-300 bg-white rounded px-3 py-1 text-sm hover:bg-gray-200"
onClick={handleReset}
>
Letzte Messung
</button>
{/* 🔵 Rechte Seite: Dropdown */}
<div className="flex items-center space-x-2">
<label htmlFor="tdrIdSelect" className="text-sm font-semibold"> <label htmlFor="tdrIdSelect" className="text-sm font-semibold">
Messung ID Messung ID
</label> </label>
@@ -46,6 +59,7 @@ const TDRChartActionBar: React.FC = () => {
value={selectedId ?? ""} value={selectedId ?? ""}
onChange={handleSelectChange} onChange={handleSelectChange}
className="border rounded px-2 py-1 text-sm" className="border rounded px-2 py-1 text-sm"
disabled={idsForSlot.length === 0}
> >
<option value="">-- Wähle Messung --</option> <option value="">-- Wähle Messung --</option>
{idsForSlot.map((entry) => ( {idsForSlot.map((entry) => (
@@ -54,8 +68,7 @@ const TDRChartActionBar: React.FC = () => {
</option> </option>
))} ))}
</select> </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;