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

export const modalFormProps: VbenFormProps = {
  wrapperClass: 'grid-cols-12',
  commonConfig: {
    formItemClass: 'col-span-12',
    componentProps: {
      class: 'w-full',
    },
  },
  layout: 'horizontal',
  schema: [
    {
      component: 'VbenInput',
      fieldName: 'id',
      label: 'ID',
      formItemClass: 'col-span-6',
      defaultValue: '',
      dependencies: {
        show: false,
        triggerFields: ['id'],
      },
    },
    {
      // 1 回访结果 / 2 回访标签；区分后续列表渲染
      component: 'VbenSelect',
      componentProps: {
        placeholder: '请选择类型',
        options: [
          { label: '回访结果', value: 1 },
          { label: '回访标签', value: 2 },
        ],
      },
      fieldName: 'type',
      label: '类型',
      rules: 'required',
      defaultValue: 1,
    },
    {
      component: 'VbenInput',
      componentProps: {
        placeholder: '请输入展示名（如 接通/关怀）',
      },
      fieldName: 'name',
      label: '名称',
      rules: 'required',
      defaultValue: '',
    },
    {
      // 小程序存储的英文/拼音 value；与历史记录匹配
      component: 'VbenInput',
      componentProps: {
        placeholder: '请输入存储值（如 connected/care）',
      },
      fieldName: 'value',
      label: '存储值',
      rules: 'required',
      defaultValue: '',
    },
    {
      // hex 颜色，用于小程序彩色 tag
      component: 'VbenInput',
      componentProps: {
        placeholder: '请输入 hex 颜色，如 #6acdbb',
      },
      fieldName: 'color',
      label: '颜色',
      defaultValue: '#6acdbb',
    },
    {
      component: 'VbenInputNumber',
      componentProps: {
        min: 0,
        precision: 0,
      },
      fieldName: 'sort',
      label: '排序',
      defaultValue: 0,
    },
    {
      component: 'VbenSelect',
      componentProps: {
        placeholder: '请选择状态',
        options: [
          { label: '启用', value: 1 },
          { label: '禁用', value: 0 },
        ],
      },
      fieldName: 'status',
      label: '状态',
      formItemClass: 'col-span-6',
      defaultValue: 1,
    },
  ],
  showDefaultActions: false,
};
