import { TAB_GENERAL } from '../constants';

export const validationScheme = [
  {
    fieldName: 'name',
    tabId: TAB_GENERAL,
    validation: (value) => {
      if (!value) {
        return 'Field cannot be empty';
      }

      if (value.length > 45) {
        return 'Field must be less than or equal to 45 Symbols';
      }

      return '';
    },
  },
  {
    fieldName: 'suffix',
    tabId: TAB_GENERAL,
    validation: (value) => {
      if (!value) {
        return 'Field cannot be empty';
      }

      if (value.length > 256) {
        return 'Field must be less than or equal to 256 Symbols';
      }

      return '';
    },
  },
  {
    fieldName: 'helpPageUrl',
    tabId: TAB_GENERAL,
    validation: (value) => {
      if (!value) {
        return 'Field cannot be empty';
      }

      if (value.length > 256) {
        return 'Field must be less than or equal to 256 Symbols';
      }

      return '';
    },
  },
];
