// categorySlice.ts
import { createSlice, PayloadAction } from '@reduxjs/toolkit';

interface CategoryState {
  selectedCategory: string;
  selectedCategoryID : string;
}

const initialState: CategoryState = {
  selectedCategory: 'Women',
  selectedCategoryID:'64f31f9ead61e014230ddf82',
};

const categorySlice = createSlice({
  name: 'category',
  initialState,
  reducers: {
    setCategory: (state, action: PayloadAction<{ category: string; categoryID: string }>) => {
      state.selectedCategory = action.payload.category;
      state.selectedCategoryID = action.payload.categoryID;
    },
  },
});

export const { setCategory } = categorySlice.actions;
export default categorySlice.reducer;

