import { ROTATION_DASHBOARD, useTranslation } from 'core/i18n';
import { TRotationMessage, TypeRotationDeviceEndpointMessage } from './types';

export function useRotationMessage(): Omit<TRotationMessage, 'sizeRotations'> {
  const { t } = useTranslation([ROTATION_DASHBOARD]);

  return {
    incidents: {
      title: t('rotation_dashboard:app.rotation_dashboard.incidents_title'),
      tooltip: t('rotation_dashboard:app.rotation_dashboard.incidents_tooltip'),
    },
    events: {
      title: t('rotation_dashboard:app.rotation_dashboard.events_title'),
      tooltip: t('rotation_dashboard:app.rotation_dashboard.events_tooltip'),
    },
    save: t('rotation_dashboard:app.rotation_dashboard.save'),
    messageTitle: t(
      'rotation_dashboard:app.rotation_dashboard.notification_saved.title',
    ),
    messageDescription: t(
      'rotation_dashboard:app.rotation_dashboard.notification_saved.description',
    ),
    validateMessage: {
      sizeRotations: t(
        'rotation_dashboard:app.rotation_dashboard.size_rotation.validate_message',
      ),
      period: t(
        'rotation_dashboard:app.rotation_dashboard.period.validate_message',
      ),
      time: t(
        'rotation_dashboard:app.rotation_dashboard.time.validate_message',
      ),
      week: t(
        'rotation_dashboard:app.rotation_dashboard.week.validate_message',
      ),
      month: t(
        'rotation_dashboard:app.rotation_dashboard.month.validate_message',
      ),
    },
    typeRotation: {
      title: t('rotation_dashboard:app.rotation_dashboard.type_rotation.title'),
      time: t('rotation_dashboard:app.rotation_dashboard.type_rotation.time'),
      size: t('rotation_dashboard:app.rotation_dashboard.type_rotation.size'),
      disabled: t(
        'rotation_dashboard:app.rotation_dashboard.type_rotation.disabled',
      ),
    },
    timeRotation: {
      title: t('rotation_dashboard:app.rotation_dashboard.period.title'),
      subTitle: t('rotation_dashboard:app.rotation_dashboard.period.sub_title'),
      timeSubTitle: t(
        'rotation_dashboard:app.rotation_dashboard.period.time.sub_title',
      ),
      time: t('rotation_dashboard:app.rotation_dashboard.type_rotation.time'),
      day: t('rotation_dashboard:app.rotation_dashboard.period.day'),
      week: t('rotation_dashboard:app.rotation_dashboard.period.week'),
      month: t('rotation_dashboard:app.rotation_dashboard.period.month'),
    },
    week: {
      title: t(
        'rotation_dashboard:app.rotation_dashboard.period.day_of_the_week',
      ),
      subTitle: t(
        'rotation_dashboard:app.rotation_dashboard.period.week.sub_title',
      ),

      placeholder: t(
        'rotation_dashboard:app.rotation_dashboard.period.week.placeholder',
      ),
      sunday: t('rotation_dashboard:app.rotation_dashboard.period.week.sunday'),
      monday: t('rotation_dashboard:app.rotation_dashboard.period.week.monday'),
      tuesday: t(
        'rotation_dashboard:app.rotation_dashboard.period.week.tuesday',
      ),
      wednesday: t(
        'rotation_dashboard:app.rotation_dashboard.period.week.wednesday',
      ),
      thursday: t(
        'rotation_dashboard:app.rotation_dashboard.period.week.thursday',
      ),
      friday: t('rotation_dashboard:app.rotation_dashboard.period.week.friday'),
      saturday: t(
        'rotation_dashboard:app.rotation_dashboard.period.week.saturday',
      ),
    },
    month: {
      subTitle: t(
        'rotation_dashboard:app.rotation_dashboard.period.month.sub_title',
      ),
      placeholder: t(
        'rotation_dashboard:app.rotation_dashboard.period.month.placeholder',
      ),
      january: t(
        'rotation_dashboard:app.rotation_dashboard.period.month.january',
      ),
      february: t(
        'rotation_dashboard:app.rotation_dashboard.period.month.february',
      ),
      march: t('rotation_dashboard:app.rotation_dashboard.period.month.march'),
      april: t('rotation_dashboard:app.rotation_dashboard.period.month.april'),
      may: t('rotation_dashboard:app.rotation_dashboard.period.month.may'),
      june: t('rotation_dashboard:app.rotation_dashboard.period.month.june'),
      july: t('rotation_dashboard:app.rotation_dashboard.period.month.july'),
      august: t(
        'rotation_dashboard:app.rotation_dashboard.period.month.august',
      ),
      september: t(
        'rotation_dashboard:app.rotation_dashboard.period.month.september',
      ),
      october: t(
        'rotation_dashboard:app.rotation_dashboard.period.month.october',
      ),
      november: t(
        'rotation_dashboard:app.rotation_dashboard.period.month.november',
      ),
      december: t(
        'rotation_dashboard:app.rotation_dashboard.period.month.december',
      ),
    },
  };
}

export const useRotationIncidentsMessage = (): TRotationMessage => {
  const { t } = useTranslation([ROTATION_DASHBOARD]);
  return {
    ...useRotationMessage(),
    sizeRotations: {
      title: t(
        'rotation_dashboard:app.rotation_dashboard.size.incidents.title',
      ),
      subTitle: t(
        'rotation_dashboard:app.rotation_dashboard.size.incidents.sub_title',
      ),
    },
  };
};

export const useRotationEventsMessage = (): TRotationMessage => {
  const { t } = useTranslation([ROTATION_DASHBOARD]);
  return {
    ...useRotationMessage(),
    sizeRotations: {
      title: t('rotation_dashboard:app.rotation_dashboard.events_title'),
      subTitle: t(
        'rotation_dashboard:app.rotation_dashboard.size.events.sub_title',
      ),
    },
  };
};

export const useRotationDeviceEndpointMessage =
  (): TypeRotationDeviceEndpointMessage => {
    const { t } = useTranslation([ROTATION_DASHBOARD]);
    return {
      sizeRotations: {
        title: t(
          'rotation_dashboard:app.rotation_dashboard.device.endpoint.card_info.size.title',
        ),
        subTitle: t(
          'rotation_dashboard:app.rotation_dashboard.device.endpoint.card_info.size.sub_title',
        ),
      },
      day: {
        title: t(
          'rotation_dashboard:app.rotation_dashboard.device.endpoint.card_info.period.day.title',
        ),
        subTitle: t(
          'rotation_dashboard:app.rotation_dashboard.device.endpoint.card_info.period.day.sub_title',
        ),
      },
      week: {
        title: t(
          'rotation_dashboard:app.rotation_dashboard.device.endpoint.card_info.period.week.title',
        ),
        subTitle: t(
          'rotation_dashboard:app.rotation_dashboard.device.endpoint.card_info.period.week.sub_title',
        ),
      },
      month: {
        title: t(
          'rotation_dashboard:app.rotation_dashboard.device.endpoint.card_info.period.month.title',
        ),
        subTitle: t(
          'rotation_dashboard:app.rotation_dashboard.device.endpoint.card_info.period.month.sub_title',
        ),
      },
      validateMessage: {
        sizeRotations: t(
          'rotation_dashboard:app.rotation_dashboard.size_rotation.validate_message',
        ),
      },
      typeRotation: {
        title: t(
          'rotation_dashboard:app.rotation_dashboard.type_rotation.title',
        ),
        size: t('rotation_dashboard:app.rotation_dashboard.type_rotation.size'),
        time: t('rotation_dashboard:app.rotation_dashboard.type_rotation.time'),
      },
    };
  };
