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

const initialState = {
  video: null,
  metaData: [],
  tabIndex: 0,
  videoStatusUpdateInProgress: false,
  videoVerificationUpdateInProgress: false,
  videoDeleteInProgress: false,
  monitoringJobs: [],
  monitoringInProgress: false,
  monitoring: false,
  inlineEdit: {},
};

export const slice = createSlice({
  name: '@@details/DETAILS',
  initialState,
  reducers: {
    loadAction: (state) => state,
    taggerAction: (state) => state,
    taglogTaggerAction: (state) => state,
    videoStatusAction: (state) => state,
    videoStatusUpdateProgressAction: (state, action) => {
      state.videoStatusUpdateInProgress = action.payload;
    },
    videoVerificationUpdateProgressAction: (state, action) => {
      state.videoVerificationUpdateInProgress = action.payload;
    },
    videoDeleteProgressAction: (state, action) => {
      state.videoDeleteInProgress = action.payload;
    },
    videoDeleteEventAction: (state) => state,
    videoUpdatedAction: (state, action) => {
      state.video = action.payload;
    },
    monitoringAction: (state, action) => {
      state.monitoring = action.payload;
    },
    monitoringDataAction: (state, action) => {
      state.monitoringJobs = action.payload;
    },
    monitoringStartAction: (state) => state,
    monitoringInProgressAction: (state, action) => {
      state.monitoringInProgress = action.payload;
    },
    videoJobAction: (state) => state,
    videoVerificationAction: (state) => state,
    videoDeleteAction: (state) => state,
    tagsCloudClickAction: (state) => state,
  },
});

export const {
  loadAction,
  taggerAction,
  taglogTaggerAction,
  videoStatusAction,
  videoStatusUpdateProgressAction,
  videoVerificationUpdateProgressAction,
  videoDeleteProgressAction,
  videoDeleteEventAction,
  videoUpdatedAction,
  monitoringAction,
  monitoringDataAction,
  monitoringStartAction,
  monitoringInProgressAction,
  videoJobAction,
  videoVerificationAction,
  videoDeleteAction,
  tagsCloudClickAction,
} = slice.actions;
