{"size": 882, "ext": "js", "max_stars_repo_path": "src/Redux/Reducers/personalReducer.js", "max_stars_repo_name": "hieuhunter/webbh_thoitrang", "max_stars_repo_stars_event_min_datetime": "2021-06-11T06:04:53.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-10T08:30:02.000Z", "max_issues_repo_path": "src/Redux/Reducers/personalReducer.js", "max_issues_repo_name": "hieuhunter/webbh_thoitrang", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/Redux/Reducers/personalReducer.js", "max_forks_repo_name": "hieuhunter/webbh_thoitrang", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.7659574468, "max_line_length": 59, "alphanum_fraction": 0.5249433107}
import {
  PERSONAL_FAILED,
  PERSONAL_REQUESTED,
  PERSONAL_SUCCEED,
} from "../Constants/contant";

const initialState = {
  thong_tin: {
    tt: {},
    is_loading: false,
    errors: {},
  },
};
const personalReducer = (state = initialState, action) => {
  switch (action.type) {
    case PERSONAL_REQUESTED:
      return {
        ...state,
        thong_tin: {
          ...state.thong_tin,
          is_loading: true,
        },
      };
    case PERSONAL_SUCCEED:
      return {
        ...state,
        thong_tin: {
          ...state.thong_tin,
          tt: action.payload.tt,
          is_loading: false,
        },
      };
    case PERSONAL_FAILED:
      return {
        ...state,
        thong_tin: {
          ...state.thong_tin,
          errors: action.payload.errors,
        },
      };
    default:
      return state;
  }
};

export default personalReducer;
