import React from 'react';

export enum HooksFeedType {
  /**
   * Regular Hooks feed with recommendations
   */
  Recommendations = 'recommendations',
  /**
   * Hooks from a specific user
   */
  Profile = 'profile',
  /**
   * Hooks liked by the current user
   */
  Liked = 'liked',
  /**
   * Admin moderation feed
   */
  Moderation = 'moderation',
}

export enum HookStaffReviewStatus {
  Unreviewed = 0,
  Flagged = 1,
  Approved = 2,
}

export enum HookLyricDisplay {
  BottomLeft = 'bottom_left_line',
  BottomLeftWord = 'bottom_left_word', // @TODO: backend to consolidate to 'bottom_left'
  CenteredLine = 'centered_line',
  CenteredWord = 'centered_word',
}

export const DEFAULT_FEED_PAGE_SIZE = 10;

/**
 * Default batch size for the view tracker
 *
 * If we have this many pending views or more, we will flush them to the server
 * and restart counting
 */
export const VIEW_TRACKER_BATCH_SIZE = 5;

/**
 * Maximum amount of time to hold on to pending views in the view tracker
 * before automatically flushing them even if we haven't met the batch size
 */
export const VIEW_TRACKER_FLUSH_DEBOUNCE_MS = 30000; // 30 seconds

/**
 * Hook action handles have a payload
 */
export type HookActionHandler<
  P extends object = object,
  E extends Event | React.SyntheticEvent | undefined = React.MouseEvent | Event,
> = (
  payload: {
    index?: number;
    hookId: string;
    clipId?: string;
    recommendationItemId?: string;
  } & P,
  e: E
) => void;
