import {
  INCIDENT_CARD_INFO,
  NCIRCC_NOTIFICATION,
  INCIDENTS_DASHBOARD,
  useTranslation,
} from 'core/i18n';
import { TypeIncidentDashboardMessage } from './types';
import { FormFields } from './NCIRCCNotificationForm/types';
import { EIncidentStatusLabel } from 'types/default';

export const useIncidentDashboardMessage = (): TypeIncidentDashboardMessage => {
  const { t } = useTranslation([
    INCIDENT_CARD_INFO,
    NCIRCC_NOTIFICATION,
    INCIDENTS_DASHBOARD,
  ]);

  return {
    leftSidebar: {
      title: t(
        'incidents_dashboard:app.incidents_dashboard.left_sidebar.incidents.title',
      ),
      list: t(
        'incidents_dashboard:app.incidents_dashboard.left_sidebar.incidents.list',
      ),
    },
    table: {
      columns: {
        id: t('incidents_dashboard:app.incidents_dashboard.table.column.id'),
        importance: {
          title: t(
            'incidents_dashboard:app.incidents_dashboard.table.column.importance.title',
          ),
          low: t(
            'incidents_dashboard:app.incidents_dashboard.table.column.importance.low',
          ),
          middle: t(
            'incidents_dashboard:app.incidents_dashboard.table.column.importance.middle',
          ),
          high: t(
            'incidents_dashboard:app.incidents_dashboard.table.column.importance.high',
          ),
        },
        title: t(
          'incidents_dashboard:app.incidents_dashboard.table.column.title',
        ),
        status: {
          title: t(
            'incidents_dashboard:app.incidents_dashboard.table.column.status.title',
          ),
          type: {
            [EIncidentStatusLabel.Not_Assigned]: t(
              'incidents_dashboard:app.incidents_dashboard.table.column.status.type.not_assigned',
            ),
            [EIncidentStatusLabel.Assigned]: t(
              'incidents_dashboard:app.incidents_dashboard.table.column.status.type.assigned',
            ),
            [EIncidentStatusLabel.Resolved]: t(
              'incidents_dashboard:app.incidents_dashboard.table.column.status.type.resolved',
            ),
            [EIncidentStatusLabel.False_Alarm]: t(
              'incidents_dashboard:app.incidents_dashboard.table.column.status.type.false_alarm',
            ),
            [EIncidentStatusLabel.Delayed]: t(
              'incidents_dashboard:app.incidents_dashboard.table.column.status.type.delayed',
            ),
          },
        },
        events: t(
          'incidents_dashboard:app.incidents_dashboard.table.column.events',
        ),
        group: t(
          'incidents_dashboard:app.incidents_dashboard.table.column.group',
        ),
        info: t(
          'incidents_dashboard:app.incidents_dashboard.table.column.info',
        ),
        updated: t(
          'incidents_dashboard:app.incidents_dashboard.table.column.updated',
        ),
        actions: {
          title: t(
            'incidents_dashboard:app.incidents_dashboard.table.column.actions.title',
          ),
          edit: t(
            'incidents_dashboard:app.incidents_dashboard.table.column.actions.edit',
          ),
          resolveIncident: t(
            'incidents_dashboard:app.incidents_dashboard.table.column.actions.resolve_incident',
          ),
        },
      },
    },

    incidentsCardInfo: {
      edit: t('incident_card_info:app.incident_card_info.form.edit'),
      resolve: t('incident_card_info:app.incident_card_info.form.resolve'),
      resolved: t('incident_card_info:app.incident_card_info.form.resolved'),
      save: t('incident_card_info:app.incident_card_info.form.save'),
      drawerButtonOpen: {
        send: t(
          'ncircc_notification:app.ncircc_notification.button.open_drawer.send',
        ),
        show: t(
          'ncircc_notification:app.ncircc_notification.button.open_drawer.show',
        ),
        additional: t(
          'ncircc_notification:app.ncircc_notification.button.open_drawer.additional',
        ),
        correctTime: (time) =>
          t(
            'ncircc_notification:app.ncircc_notification.button.open_drawer.sub_text.correct_time',
            {
              time,
            },
          ),
        invalidTime: t(
          'ncircc_notification:app.ncircc_notification.button.open_drawer.sub_text.invalid_time',
        ),
        ifNoSend: t(
          'ncircc_notification:app.ncircc_notification.button.open_drawer.sub_text.if_no_send',
        ),
        createCompany: t(
          'ncircc_notification:app.ncircc_notification.button.open_drawer.sub_text.create_company',
        ),
      },
      formItem: {
        smallCardMessages: {
          importance: t(
            'incident_card_info:app.incident_card_info.form.item.importance',
          ),
          title: t('incident_card_info:app.incident_card_info.form.item.title'),
          events: t(
            'incident_card_info:app.incident_card_info.form.item.events',
          ),
          status: t(
            'incident_card_info:app.incident_card_info.form.item.status',
          ),
          deadline: t(
            'incident_card_info:app.incident_card_info.form.item.deadline',
          ),
          groups: t(
            'incident_card_info:app.incident_card_info.form.item.groups',
          ),
          assignedTo: t(
            'incident_card_info:app.incident_card_info.form.item.assigned_to',
          ),
          created: t(
            'incident_card_info:app.incident_card_info.form.item.events_table.created',
          ),
          comment: t(
            'incident_card_info:app.incident_card_info.form.item.description',
          ),
          assignedToError: t(
            'incident_card_info:app.incident_card_info.form.item.assigned_to.error',
          ),
          statusOptionMessage: {
            notAssigned: t(
              'incident_card_info:app.incident_card_info.form.item.status_option.notAssigned',
            ),
            assigned: t(
              'incident_card_info:app.incident_card_info.form.item.status_option.assigned',
            ),
            delayed: t(
              'incident_card_info:app.incident_card_info.form.item.status_option.delayed',
            ),
            resolve: t(
              'incident_card_info:app.incident_card_info.form.item.status_option.resolve',
            ),
            falseAlarm: t(
              'incident_card_info:app.incident_card_info.form.item.status_option.falseAlarm',
            ),
          },
        },
        largeCardMessages: {
          main: {
            name: t(
              'incident_card_info:app.incident_card_info.form.item.block_name.main',
            ),
            title: t(
              'incident_card_info:app.incident_card_info.form.item.title',
            ),
            created: t(
              'incident_card_info:app.incident_card_info.form.item.events_table.created',
            ),
            deadline: t(
              'incident_card_info:app.incident_card_info.form.item.deadline',
            ),
            importance: t(
              'incident_card_info:app.incident_card_info.form.item.importance',
            ),
            comment: t(
              'incident_card_info:app.incident_card_info.form.item.description',
            ),
            groups: t(
              'incident_card_info:app.incident_card_info.form.item.groups',
            ),
          },
          details: {
            name: t(
              'incident_card_info:app.incident_card_info.form.item.block_name.details',
            ),
            assignedTo: t(
              'incident_card_info:app.incident_card_info.form.item.assigned_to',
            ),
            assignedToError: t(
              'incident_card_info:app.incident_card_info.form.item.assigned_to.error',
            ),
            status: t(
              'incident_card_info:app.incident_card_info.form.item.status',
            ),
            statusOptionMessage: {
              notAssigned: t(
                'incident_card_info:app.incident_card_info.form.item.status_option.notAssigned',
              ),
              assigned: t(
                'incident_card_info:app.incident_card_info.form.item.status_option.assigned',
              ),
              delayed: t(
                'incident_card_info:app.incident_card_info.form.item.status_option.delayed',
              ),
              resolve: t(
                'incident_card_info:app.incident_card_info.form.item.status_option.resolve',
              ),
              falseAlarm: t(
                'incident_card_info:app.incident_card_info.form.item.status_option.falseAlarm',
              ),
            },
          },
          recommendation: {
            name: t(
              'incident_card_info:app.incident_card_info.form.item.block_name.recommendations',
            ),
          },
          effects: {
            name: t(
              'incident_card_info:app.incident_card_info.form.item.block_name.effects',
            ),
          },
          events: {
            name: t(
              'incident_card_info:app.incident_card_info.form.item.block_name.events',
            ),
          },
          eventsTable: {
            created: t(
              'incident_card_info:app.incident_card_info.form.item.events_table.created',
            ),
            message: t(
              'incident_card_info:app.incident_card_info.form.item.events_table.message',
            ),
            product: t(
              'incident_card_info:app.incident_card_info.form.item.events_table.product',
            ),
            sourceIp: t(
              'incident_card_info:app.incident_card_info.form.item.events_table.source_ip',
            ),
            destinationIp: t(
              'incident_card_info:app.incident_card_info.form.item.events_table.destination_ip',
            ),
          },
          recommendationAndEffectsTable: {
            name: t(
              'incident_card_info:app.incident_card_info.form.item.title',
            ),
            description: t(
              'incident_card_info:app.incident_card_info.form.item.description',
            ),
          },
        },
      },
      notification: {
        failedPatchIncident: t(
          'incident_card_info:app.incident_card_info.notification.failed_patch_incident',
        ),
        failedFetchCompanyInfo: t(
          'incident_card_info:app.incident_card_info.notification.failed_fetch_company_info',
        ),
      },
    },
    ncircc: {
      title: t('ncircc_notification:app.ncircc_notification.title'),
      submit: t('ncircc_notification:app.ncircc_notification.button.submit'),
      notification: {
        postNotification: {
          success: {
            title: t(
              'ncircc_notification:app.ncircc_notification.notification.post.success',
            ),
          },
          error: {
            title: t(
              'ncircc_notification:app.ncircc_notification.notification.post.error.title',
            ),
            subTitle: t(
              'ncircc_notification:app.ncircc_notification.notification.error.sub_title',
            ),
          },
        },
        patchNotification: {
          success: {
            title: t(
              'ncircc_notification:app.ncircc_notification.notification.patch.success',
            ),
          },
          error: {
            title: t(
              'ncircc_notification:app.ncircc_notification.notification.patch.error.title',
            ),
            subTitle: t(
              'ncircc_notification:app.ncircc_notification.notification.error.sub_title',
            ),
          },
        },
      },
      drawerCloseConfirmModal: {
        title: t(
          'ncircc_notification:app.ncircc_notification.button.close_drawer_confirm_modal.title',
        ),
        subTitle: t(
          'ncircc_notification:app.ncircc_notification.button.close_drawer_confirm_modal.sub_title',
        ),
        okText: t(
          'ncircc_notification:app.ncircc_notification.button.close_drawer_confirm_modal.ok',
        ),
        cancelText: t(
          'ncircc_notification:app.ncircc_notification.button.close_drawer_confirm_modal.cancel',
        ),
      },
      formFieldsMessages: {
        [FormFields.CATEGORY]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.category',
        ),
        [FormFields.IDENTIFIER]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.identifier',
        ),
        [FormFields.TYPE]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.type',
        ),
        [FormFields.ACTIVITY_STATUS]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.activity_status',
        ),
        [FormFields.TLP]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.tlp',
        ),
        [FormFields.AFFECTED_SYSTEM_NAME]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.affected_system_name',
        ),
        [FormFields.AFFECTED_SYSTEM_CATEGORY]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.affected_system_category',
        ),
        [FormFields.EVENT_DESCRIPTION]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.event_description',
        ),
        [FormFields.AFFECTED_SYSTEM_CONNECTION]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.affected_system_connection',
        ),
        [FormFields.ASSISTANCE]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.assistance',
        ),
        [FormFields.INTEGRITY_IMPACT]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.integrity_impact',
        ),
        [FormFields.AVAILABILITY_IMPACT]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.availability_impact',
        ),
        [FormFields.CONFIDENTIALITY_IMPACT]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.confidentiality_impact',
        ),
        [FormFields.CUSTOM_IMPACT]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.custom_impact',
        ),
        [FormFields.VULNERABILITY_ID]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.vulnerability_id',
        ),
        [FormFields.PRODUCT_CATEGORY]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.product_category',
        ),
        [FormFields.ADDITIONAL]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.additional',
        ),
        [FormFields.EFFECTS]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.effects',
        ),
        [FormFields.NOTIFICATION_STATUS]: t(
          'ncircc_notification:app.ncircc_notification.form_fields.notification_status',
        ),
      },
      formOptionsLabelMessages: {
        incidentTypeOptionMessages: {
          involvementOfAControlledResource: t(
            'ncircc_notification:app.ncircc_notification.form_option.incident_type.involvement_of_controlled_resource',
          ),
          resourceSlowdown: t(
            'ncircc_notification:app.ncircc_notification.form_option.incident_type.resource_slowdown',
          ),
          malwareInfection: t(
            'ncircc_notification:app.ncircc_notification.form_option.incident_type.malware_infection',
          ),
          capturingNetworkTraffic: t(
            'ncircc_notification:app.ncircc_notification.form_option.incident_type.capturing_network_traffic',
          ),
          accountCompromise: t(
            'ncircc_notification:app.ncircc_notification.form_option.incident_type.account_compromise',
          ),
          unauthorizedChangeOfInformation: t(
            'ncircc_notification:app.ncircc_notification.form_option.incident_type.unauthorized_change_of_information',
          ),
          unauthorizedDisclosureOfInformation: t(
            'ncircc_notification:app.ncircc_notification.form_option.incident_type.unauthorized_disclosure_of_information',
          ),
          publicationOfProhibitedInformationOnTheResource: t(
            'ncircc_notification:app.ncircc_notification.form_option.incident_type.publication_of_prohibited_information_on_the_resource',
          ),
          sendingSpamMessages: t(
            'ncircc_notification:app.ncircc_notification.form_option.incident_type.sending_spam_messages',
          ),
          successfulExploitationOfAVulnerability: t(
            'ncircc_notification:app.ncircc_notification.form_option.incident_type.successful_exploitation_of_vulnerability',
          ),
        },
        attackTypeOptionsMessages: {
          failedAuthorizationAttempts: t(
            'ncircc_notification:app.ncircc_notification.form_option.attack_type.failed_authorization_attempts',
          ),
          attemptsToExploitTheVulnerability: t(
            'ncircc_notification:app.ncircc_notification.form_option.attack_type.attempts_to_exploit_the_vulnerability',
          ),
          attemptsToIntroduceMalware: t(
            'ncircc_notification:app.ncircc_notification.form_option.attack_type.attempts_to_introduce_malware',
          ),
          publicationOfFraudulentInformation: t(
            'ncircc_notification:app.ncircc_notification.form_option.attack_type.publication_of_fraudulent_information',
          ),
          dDoSAttack: t(
            'ncircc_notification:app.ncircc_notification.form_option.attack_type.ddos_attack',
          ),
          socialEngineering: t(
            'ncircc_notification:app.ncircc_notification.form_option.attack_type.social_engineering',
          ),
          networkScanning: t(
            'ncircc_notification:app.ncircc_notification.form_option.attack_type.network_scanning',
          ),
        },
        vulnerabilityTypeOptionMessages: {
          vulnerableResource: t(
            'ncircc_notification:app.ncircc_notification.form_option.vulnerability_type.vulnerable_resource',
          ),
        },
        activityStatusOptionsMessages: {
          actionTaken: t(
            'ncircc_notification:app.ncircc_notification.form_option.activity_status.action_taken',
          ),
          responseActivitiesAreUnderway: t(
            'ncircc_notification:app.ncircc_notification.form_option.activity_status.response_activities_are_underway',
          ),
          responseActivitiesResumed: t(
            'ncircc_notification:app.ncircc_notification.form_option.activity_status.response_activities_resumed',
          ),
        },
        tlpStatusOptionsMessages: {
          WHITE: t(
            'ncircc_notification:app.ncircc_notification.form_option.tlp_status.white',
          ),
          GREEN: t(
            'ncircc_notification:app.ncircc_notification.form_option.tlp_status.green',
          ),
          AMBER: t(
            'ncircc_notification:app.ncircc_notification.form_option.tlp_status.amber',
          ),
          RED: t(
            'ncircc_notification:app.ncircc_notification.form_option.tlp_status.red',
          ),
        },
        impactOptionMessages: {
          high: t(
            'ncircc_notification:app.ncircc_notification.form_option.impact_type.high',
          ),
          low: t(
            'ncircc_notification:app.ncircc_notification.form_option.impact_type.low',
          ),
          missing: t(
            'ncircc_notification:app.ncircc_notification.form_option.impact_type.missing',
          ),
        },
        optionsNcirccNotificationMessages: {
          computerIncidentNotification: t(
            'ncircc_notification:app.ncircc_notification.form_option.ncircc_type.computer_incident_notification',
          ),
          computerAttackNotification: t(
            'ncircc_notification:app.ncircc_notification.form_option.ncircc_type.computer_attack_notification',
          ),
          vulnerabilityNotification: t(
            'ncircc_notification:app.ncircc_notification.form_option.ncircc_type.vulnerability_notification',
          ),
        },
        affectedSystemCategoryMessages: {
          informationResourceIsNotAnObjectOfCii: t(
            'ncircc_notification:app.ncircc_notification.form_option.affected_system_category.information_resource_is_not_an_object_of_cii',
          ),
          ciiObjectWithoutSignificanceCategory: t(
            'ncircc_notification:app.ncircc_notification.form_option.affected_system_category.cii_object_without_significance_category',
          ),
          ciiObjectOfTheThirdCategoryOfSignificance: t(
            'ncircc_notification:app.ncircc_notification.form_option.affected_system_category.cii_object_of_the_third_category_of_significance',
          ),
          ciiObjectOfTheSecondCategoryOfSignificance: t(
            'ncircc_notification:app.ncircc_notification.form_option.affected_system_category.cii_object_of_the_second_category_of_significance',
          ),
          ciiObjectOfTheFirstCategoryOfSignificance: t(
            'ncircc_notification:app.ncircc_notification.form_option.affected_system_category.cii_object_of_the_first_category_of_significance',
          ),
        },
      },
      formItemsRules: {
        [FormFields.TYPE]: t(
          'incident_card_info:app.incident_card_info.form.item.rules.type',
        ),
        [FormFields.ACTIVITY_STATUS]: t(
          'incident_card_info:app.incident_card_info.form.item.rules.activity_status',
        ),
        [FormFields.TLP]: t(
          'incident_card_info:app.incident_card_info.form.item.rules.tlp',
        ),
        [FormFields.AFFECTED_SYSTEM_NAME]: t(
          'incident_card_info:app.incident_card_info.form.item.rules.affected_system_name',
        ),
        [FormFields.EVENT_DESCRIPTION]: t(
          'incident_card_info:app.incident_card_info.form.item.rules.event_description',
        ),
        [FormFields.INTEGRITY_IMPACT]: t(
          'incident_card_info:app.incident_card_info.form.item.rules.integrity_impact',
        ),
        [FormFields.AVAILABILITY_IMPACT]: t(
          'incident_card_info:app_incident_card_info_form.item.rules_availability_impact',
        ),
        [FormFields.CONFIDENTIALITY_IMPACT]: t(
          'incident_card_info:app_incident_card_info_form.item.rules_confidentiality_impact',
        ),
      },
    },
  };
};
