// redux/slices/selectedDeviceSlice.js
import { createSlice } from "@reduxjs/toolkit";

export const selectedDeviceSlice = createSlice({
  name: "selectedDevice",
  initialState: null,
  reducers: {
    setSelectedDevice: (state, action) => action.payload, // Speichert Device-Daten
    clearSelectedDevice: () => null, // Entfernt das Gerät aus dem State
  },
});

export const { setSelectedDevice, clearSelectedDevice } = selectedDeviceSlice.actions;
export default selectedDeviceSlice.reducer;
