/**
 * Redux Types
 */

// Notification state structure
export interface NotificationState {
  showNotification: boolean;
  textNotification: string;
  typeNotification: 'warn' | 'error' | 'success' | 'info' | '';
}

// Generic entity slice state
export interface EntitySliceState<T> {
  data: T[];
  loading: boolean;
  count: number;
  refetch: boolean;
  notify: NotificationState;
  // Index signature for dynamic entity name access (e.g., state[entityName])
  [entityName: string]: T[] | boolean | number | NotificationState | unknown;
}

// Slice factory configuration
export interface EntitySliceConfig {
  name: string;
  endpoint: string;
  singularName?: string; // For notification messages (e.g., "User" instead of "Users")
}

// Auth state structure
export interface AuthState {
  currentUser: import('./entities').User | null;
  token: string;
  isFetching: boolean;
  errorMessage: string;
  notify: NotificationState;
}

// Style state structure
export interface StyleState {
  darkMode: boolean;
  bgLayoutColor: string;
  focusRingColor: string;
  corners: string;
  cardsColor: string;
}

// Main app state structure
export interface MainState {
  isAsideMobileExpanded: boolean;
  isAsideLgActive: boolean;
}
