create.config.ts 733 Bytes
import { ScopeEnum } from '../../../enum/form';
import { useRuleChainI18n } from '../../../hook/useRuleChainI18n';
import { FormSchema } from '/@/components/Form';

const { tLabel, tPlaceholder, t } = useRuleChainI18n('action', 'pushToEdge');

export enum PushToEdgeFieldsEnum {
  SCOPE = 'scope',
}

export const formSchemas: FormSchema[] = [
  {
    field: PushToEdgeFieldsEnum.SCOPE,
    component: 'Select',
    label: tLabel(PushToEdgeFieldsEnum.SCOPE),
    required: true,
    componentProps: {
      options: Object.keys(ScopeEnum).map((value) => ({ label: t(`enum.scope.${value}`), value })),
      getPopupContainer: () => document.body,
      placeholder: tPlaceholder(PushToEdgeFieldsEnum.SCOPE, 'choose'),
    },
  },
];