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

export const formOptions: VbenFormProps = {
  wrapperClass: 'grid-cols-12',
  commonConfig: {
    formItemClass: 'col-span-12',
    componentProps: {
      class: 'w-full',
    },
  },
  layout: 'horizontal',
  schema: [
    {
      component: 'VbenInput',
      formItemClass: 'col-span-6',
      componentProps: {
        placeholder: '请输入门店名称',
      },
      fieldName: 'name',
      label: '门店名称',
    },
    {
      component: 'VbenInput',
      formItemClass: 'col-span-6',
      componentProps: {
        placeholder: '请输入联系电话',
      },
      fieldName: 'mobile',
      label: '联系电话',
    },
    {
      component: 'Select',
      formItemClass: 'col-span-6',
      componentProps: {
        placeholder: '请选择审核状态',
        options: [
          { label: '待审核', value: 0 },
          { label: '审核通过', value: 1 },
          { label: '审核拒绝', value: 2 },
        ],
      },
      fieldName: 'status',
      label: '审核状态',
    },
  ],
  showDefaultActions: false,
};

/** 审核列表：默认只看待审核 */
export const auditFormOptions: VbenFormProps = {
  ...formOptions,
  schema: formOptions.schema?.map((item) =>
    item.fieldName === 'status' ? { ...item, defaultValue: 0 } : item,
  ),
};
