// redux/slices/authSlice.ts
import { createSlice } from "@reduxjs/toolkit";

const authSlice = createSlice({
  name: "authSlice",
  initialState: {
    isAdminLoggedIn: false,
    users: {
      Admin: {
        username: "admin",
        password:
          "$2a$10$WO/pzNjkkbC4X3aCEcwd2ugMHQ8Wzq0unCYNePTAL01ZrS/rEAcGu", // Gehashte Version von "admin"
      },
      Ismail: {
        username: "ismail",
        password:
          "$2a$10$WO/pzNjkkbC4X3aCEcwd2ugMHQ8Wzq0unCYNePTAL01ZrS/rEAcGu", // Gehashte Version von "ismail"
      },
    },
  },
  reducers: {
    setAdminLoggedIn: (state, action) => {
      state.isAdminLoggedIn = action.payload;
    },
  },
});

export const { setAdminLoggedIn } = authSlice.actions;
export default authSlice.reducer;
