import {
  PendingActionFilter,
  type ReviewUser,
} from 'src/pages/dashboard/performance/types';

export const COLLABORATORS_PAGE_SIZE = 10;

export const ROW_COUNT = 5;

const FILTER_NONE = undefined;

export const PENDING_ACTION_FILTERS: PendingActionFilter[] = [
  PendingActionFilter.PENDING_SELECTION,
  PendingActionFilter.PENDING_EVALUATION,
  PendingActionFilter.PENDING_DELIVERY,
];

const SHARE_STATUS_KEYS: Record<
  NonNullable<ReviewUser['shareStatus']>,
  string
> = {
  NOT_SHARED: 'manage_team.share_status.not_shared',
  SHARED_UNCONFIRMED: 'manage_team.share_status.pending',
  SHARED_CONFIRMED: 'manage_team.share_status.shared',
  // Intentionally maps to the same string as NOT_SHARED — product currently shows
  // identical UI for both states. Differentiate when product spec evolves.
  SHARE_DISABLED: 'manage_team.share_status.not_shared',
};

export type FilterCandidate = {
  translationKey: string;
  value: PendingActionFilter | typeof FILTER_NONE;
};

export const ALL_FILTER: FilterCandidate = {
  translationKey: 'manage_team.filters.all',
  value: FILTER_NONE,
};

export const FILTER_CANDIDATES: FilterCandidate[] = [
  {
    translationKey: 'manage_team.filters.selection_pending',
    value: PendingActionFilter.PENDING_SELECTION,
  },
  {
    translationKey: 'manage_team.filters.evaluation_pending',
    value: PendingActionFilter.PENDING_EVALUATION,
  },
  {
    translationKey: 'manage_team.filters.delivery_pending',
    value: PendingActionFilter.PENDING_DELIVERY,
  },
];

export const FILTER_EMPTY_TITLE_KEYS: Record<PendingActionFilter, string> = {
  [PendingActionFilter.PENDING_SELECTION]:
    'manage_team.empty.pending_selection',
  [PendingActionFilter.PENDING_EVALUATION]:
    'manage_team.empty.pending_evaluations',
  [PendingActionFilter.PENDING_DELIVERY]:
    'manage_team.empty.pending_deliveries',
};
