import { type Theme } from '@material-hu/mui/styles';

export const DAILY_HEADERS = [
  {
    id: 'collaborator-collapsable',
    label: '',
    width: 72,
  },
  {
    id: 'collaborator',
    label: 'general:collaborator',
  },
  {
    id: 'scheduled-hours',
    label: 'SCHEDULED_SINGULAR',
  },
  {
    id: 'worked-hours',
    label: 'WORKED',
  },
  {
    id: 'trackings',
    label: 'TRACKINGS',
  },
  {
    id: 'incidences',
    label: 'INCIDENCES',
  },
  {
    id: 'options',
    label: '',
    width: 72,
  },
];

export const PERIOD_HEADERS = [
  {
    id: 'collaborator',
    label: 'general:collaborator',
  },
  {
    id: 'scheduled-hours',
    label: 'SCHEDULED_SINGULAR',
  },
  {
    id: 'worked-hours',
    label: 'WORKED',
  },
  {
    id: 'balance',
    label: 'BALANCE',
  },
  {
    id: 'extra-hours',
    label: 'EXTRA_TIME',
  },
  {
    id: 'incidences',
    label: 'INCIDENCES',
  },
  {
    id: 'options',
    label: '',
    width: 72,
  },
];

export const STICKY_OPTIONS_CELL_SX = {
  position: 'sticky',
  right: 0,
  zIndex: 2,
  backgroundColor: ({ palette }: Theme) =>
    palette.new.background.elements.default,
};

export const STICKY_OPTIONS_HEADER_SX = {
  position: 'sticky',
  right: 0,
  zIndex: 3,
} as const;

export const headerTextStyles = {
  fontWeight: 600,
  fontSize: 16,
  p: 2,
};

export const getHeaders = (isDailyView: boolean) =>
  isDailyView ? DAILY_HEADERS : PERIOD_HEADERS;
