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

interface SelectedChartDataState {
  selectedChartData: any;
}

const initialState: SelectedChartDataState = {
  selectedChartData: null,
};

const selectedChartDataSlice = createSlice({
  name: "selectedChartDataSlice",
  initialState,
  reducers: {
    setSelectedChartData(state, action: PayloadAction<any>) {
      state.selectedChartData = action.payload;
    },
  },
});

export const { setSelectedChartData } = selectedChartDataSlice.actions;
export default selectedChartDataSlice.reducer;
