// src/store/userinfo.js
import { createSlice } from '@reduxjs/toolkit';

const userinfo = createSlice({
  name: 'user',
  initialState: {
    userdata: null
  },
  reducers: {
    setUserInfo(state, action) {
      state.userdata = action.payload;
    }
    // clearUserInfo(state) {
    //   state.userdata = null;
    // }
  }
});

export const { setUserInfo } = userinfo.actions;
export default userinfo.reducer;
