import type { VbenFormProps } from '#/adapter/form';

import { getRoleOption } from '#/views/system/role/api';

export const formOptions: VbenFormProps = {
  wrapperClass: 'grid-cols-12',
  commonConfig: {
    formItemClass: 'col-span-6',
    componentProps: {
      class: 'w-full',
    },
  },
  layout: 'horizontal',
  schema: [
    {
      component: 'ApiSelect',
      componentProps: {
        api: getRoleOption,
        labelField: 'name',
        valueField: 'id',
        placeholder: '请选择角色',
        allowClear: true,
      },
      fieldName: 'role_id',
      label: '角色',
    },
    {
      component: 'VbenInput',
      componentProps: {
        placeholder: '请输入标题',
      },
      fieldName: 'title',
      label: '标题',
    },
  ],
  showDefaultActions: false,
};
