import {createSlice} from "@reduxjs/toolkit";

const initialState = {
    selectedUser: null,
    isCurrentUser: false
};

const usersSlice = createSlice({
    name: "usersUI",
    initialState,
    reducers: {
        setSelectedUser(state, action) {
            state.selectedUser = action.payload;
        },
        setIsCurrentUser(state, action) {
            state.isCurrentUser = action.payload;
        },
    },
});

export const {
    setSelectedUser,
    setIsCurrentUser,
} = usersSlice.actions;

export default usersSlice.reducer;