import { slice } from '../slices';

const nameSpace = slice.name;

export const videosSelector = (state) => state[nameSpace].videos;
export const totalCountSelector = (state) => state[nameSpace].totalCount;
export const isVideosLoadingSelector = (state) => state[nameSpace].isVideosLoading;
export const isNextVideosLoadingSelector = (state) => state[nameSpace].isNextVideosLoading;
export const filterParamsSelector = (state) => state[nameSpace].filterParams;
export const filterInternalParamsSelector = (state) => state[nameSpace].filterInternalParams;
export const searchFiltersSelector = (state) => state[nameSpace].searchFilters;
export const selectedVideoSelector = (state) => state[nameSpace].selectedVideo;
export const pageSelector = (state) => state[nameSpace].page;
export const sizeSelector = (state) => state[nameSpace].size;
export const playersSelector = (state) => state[nameSpace].players;
export const maxPerformanceSelector = (state) => state[nameSpace].maxPerformance;
export const isSearchFilteredSelector = (state) => state[nameSpace].isSearchFiltered;
export const targetVideoIdSelector = (state) => state[nameSpace].targetVideoId;
export const targetClipIdSelector = (state) => state[nameSpace].targetClipId;
export const isTargetClipIdLoadingSelector = (state) => state[nameSpace].isTargetClipIdLoading;
export const canAddToPlaylistSelector = (state) => state[nameSpace].canAddToPlaylist;
export const showNotificationSelector = (state) => state[nameSpace].showNotification;
export const startSearchEventSelector = (state) => state[nameSpace].startSearchEvent;
export const selectedPlayerSelector = (state) => state[nameSpace].selectedPlayer;
export const selectedAspectRatioSelector = (state) => state[nameSpace].selectedAspectRatio;
export const embedCodeSelector = (state) => state[nameSpace].embedCode;
export const getEmbedCodeSelector = (state) => state[nameSpace].getEmbedCode;
export const dragAndDropEndSelector = (state) => state[nameSpace].dragAndDropEnd;
export const playlistModeSelector = (state) => state[nameSpace].playlistMode;
export const showEmbedCodeButtonSelector = (state) => state[nameSpace].showEmbedCodeButton;
export const aiPlaylistIdSelector = (state) => state[nameSpace].aiPlaylistId;
export const showDividerSelector = (state) => state[nameSpace].showDivider;
export const currentFiltersAsStringSelector = (state) => state[nameSpace].currentFiltersAsString;

export const getCommonState = (state$) => {
  const state = state$[nameSpace];

  return {
    ...state,
  };
};

export default getCommonState;
