import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';

const SettingListMeta: IPublicTypeComponentMetadata = {
  componentName: 'SettingList',
  title: '设置列表',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/private-materials',
    version: '1.0.3',
    exportName: 'SettingList',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  props: [
    {
      title: {
        label: {
          type: 'i18n',
          'en-US': 'className',
          'zh-CN': '类名',
        },
      },
      name: 'className',
      setter: 'StringSetter',
    },
    {
      title: {
        label: {
          type: 'i18n',
          'en-US': 'style',
          'zh-CN': '样式',
        },
      },
      name: 'style',
      setter: 'StyleSetter',
    },
    {
      title: {
        label: {
          type: 'i18n',
          'en-US': 'methods',
          'zh-CN': '认证方法列表',
        },
      },
      name: 'methods',
      setter: 'JsonSetter',
    },
    {
      title: {
        label: {
          type: 'i18n',
          'en-US': 'onToggle',
          'zh-CN': '启用/禁用回调',
        },
      },
      name: 'onToggle',
      setter: 'FunctionSetter',
    },
    {
      title: {
        label: {
          type: 'i18n',
          'en-US': 'onSettings',
          'zh-CN': '设置按钮回调',
        },
      },
      name: 'onSettings',
      setter: 'FunctionSetter',
    },
    {
      title: {
        label: {
          type: 'i18n',
          'en-US': 'onConfigClick',
          'zh-CN': '配置链接回调',
        },
      },
      name: 'onConfigClick',
      setter: 'FunctionSetter',
    },
  ],
  configure: {
    component: {
      isContainer: false,
    },
    supports: {
      style: true,
      className: true,
      events: [
        {
          name: 'onToggle',
          description: '启用/禁用认证方法',
        },
        {
          name: 'onSettings',
          description: '打开设置',
        },
        {
          name: 'onConfigClick',
          description: '点击配置链接',
        },
      ],
    },
  },
};

const snippets: IPublicTypeSnippet[] = [
  {
    title: '设置列表',
    screenshot: '',
    schema: {
      componentName: 'SettingList',
      props: {},
    },
  },
];

export default {
  ...SettingListMeta,
  snippets,
};

