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

import { Incidence } from 'src/types/timeTracking';

export const CREATING_ENTRY_ID = 'creating';

export const REMOTE_WORK_SITE_VALUE = -2;

export const EMPTY_ENTRY = {
  time: undefined,
  comment: '',
  siteId: -1,
};

export const tooltipComponentProps = (customSx?: SxProps) => ({
  tooltip: {
    sx: {
      borderRadius: '4px',
      maxWidth: '207px',
      ...customSx,
    },
  },
});

export const OPEN_GOOGLE_MAPS_URL =
  'https://www.google.com/maps/search/?api=1&query=';

export const TOOLTIP_DELAY = 250;

export const UNDERWORKED_TOLERANCE = 30;

export const svgColorCorrection = (
  variant: 'neutralText' | 'neutralTextLighter',
) => ({
  '.tabler-icon': {
    color: ({ palette }: Theme) =>
      variant === 'neutralText'
        ? palette.new.text.neutral.default
        : palette.new.text.neutral.lighter,
  },
});

// These incidences should not be displayed in general
export const HIDDEN_INCIDENCES = [Incidence.FACIAL_RECOGNITION_SKIPPED];

// These incidences should not be displayed as tags
export const NON_TAG_INCIDENCES = [
  Incidence.UNDERWORKED,
  Incidence.EXTRA_HOURS,
  Incidence.NOT_CLOCKED_IN,
];

export const LOG_DELAY_MS = 5000;
