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

export type claimSubmitType = {
  id: number;
  fullName: string;
  memberId: string;
  limit: {
    current: number;
    total: number;
    percentage: number;
  };
};

type initState = {
  data: claimSubmitType[];
};

let initState: initState = {
  data: [],
};

const claimSubmitSlice = createSlice({
  name: 'claimsubmit',
  initialState: initState,
  reducers: {
    patch(state, action) {
      state.data = action.payload;
    },
    dispatch(state) {
      state.data = [];
    },
  },
});

export const claimSubmitAction = claimSubmitSlice.actions;

export default claimSubmitSlice.reducer;
