export const GENERAL_ERROR_MSG = 'An error occurred. Please try again';
export const START_WHITESPACE_ERROR = 'cannot start with whitespace characters';
export const END_WHITESPACE_ERROR = 'cannot end with whitespace characters';
export const URL_INVALID_ERROR = 'has to be a valid URL';

export const VIRTUAL_MACHINE_EXISTS =
  'is already used by another virtual machine in this namespace';
export const VIRTUAL_MACHINE_TEMPLATE_EXISTS = 'is already used in another template';

export const MAC_ADDRESS_INVALID_ERROR = 'Invalid MAC address format';
export const NIC_NAME_EXISTS = 'Interface with this name already exists';
export const NETWORK_MULTUS_NAME_EXISTS = 'Multus network with this name already exists';
export const NETWORK_REQUIRED = 'Network required';

export const POSITIVE_SIZE_ERROR = 'must be positive';

const validationKeyToNameResolver = {
  name: 'Name',
  macAddress: 'MAC Address',
  network: 'Network',
  size: 'Size',
  url: 'Url',
  container: 'Container',
  diskInterface: 'Model',
  pvc: 'PVC',
};

export const getValidationNameByKey = (key: string) => {
  return validationKeyToNameResolver[key];
};
