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

const MenuListMeta: IPublicTypeComponentMetadata = {
  group: '低代码组件',
  componentName: 'MenuList',
  title: '列表菜单组件',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  category: '信息展示',
  npm: {
    package: '@dckj-npm/dc-material',
    version: '0.1.8',
    exportName: 'MenuList',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'dataList',
            'zh-CN': '数据',
          },
          tip: 'dataList | 数据',
        },
        name: 'dataList',
        description: '数据',
        setter: {
          componentName: 'ArraySetter',
          props: {
            itemSetter: {
              componentName: 'ObjectSetter',
              props: {
                config: {
                  items: [
                    {
                      title: {
                        label: {
                          type: 'i18n',
                          'en-US': 'title',
                          'zh-CN': 'title',
                        },
                      },
                      name: 'title',
                      description: '菜单名称',
                      setter: {
                        componentName: 'StringSetter',
                        isRequired: true,
                        initialValue: '',
                      },
                    },
                    {
                      title: {
                        label: {
                          type: 'i18n',
                          'en-US': 'iconUrl',
                          'zh-CN': 'iconUrl',
                        },
                      },
                      name: 'iconUrl',
                      description: '菜单图标',
                      setter: {
                        componentName: 'CustomImageSetter',
                        isRequired: false,
                        initialValue: '',
                      },
                    },
                    {
                      title: {
                        label: {
                          type: 'i18n',
                          'en-US': 'click',
                          'zh-CN': '点击事件',
                        },
                      },
                      name: 'handleClick',
                      description: '菜单点击事件',
                      setter: {
                        componentName: 'FunctionSetter',
                        isRequired: false,
                        initialValue: '',
                      },
                    },
                  ],
                  extraSetter: {
                    componentName: 'MixedSetter',
                    isRequired: false,
                    props: {},
                  },
                },
              },
            },
          },
          initialValue: [
            {
              title: '我的名片',
              iconUrl:
                'http://122.225.55.70:18084/files/upload/2024/09/12/139d14911a124bfc956a7f725e9470e1.png',
            },
            {
              title: '邀请人名片',
              iconUrl:
                'http://122.225.55.70:18084/files/upload/2024/09/12/50cdc578b82f48a2af504b283fd3c8e5.png',
            },
            {
              title: '在线留言',
              iconUrl:
                'http://122.225.55.70:18084/files/upload/2024/09/12/204802207fff4aaca5b002adebfa4b94.png',
            },
            {
              title: '联系我们',
              iconUrl:
                'http://122.225.55.70:18084/files/upload/2024/09/12/70a8c6d97c084484a1e19bb7ff1489d3.png',
            },
            {
              title: '帮助中心',
              iconUrl:
                'http://122.225.55.70:18084/files/upload/2024/09/12/02b52f9fe2294cd68b5a1f09a229194f.png',
            },
            {
              title: '退出登录',
              iconUrl:
                'http://122.225.55.70:18084/files/upload/2024/09/12/15ac6db27c84409fbacb2ee7826c31ab.png',
            },
          ],
        },
      },
    ],
    supports: {
      style: true,
    },
    component: {
      disableBehaviors: ['copy'],
    },
  },
}
const snippets: IPublicTypeSnippet[] = [
  {
    title: '列表菜单组件',
    screenshot: '',
    schema: {
      componentName: 'MenuList',
      props: {},
    },
  },
]

export default {
  ...MenuListMeta,
  snippets,
}
