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

const SearchHistoryListMeta: IPublicTypeComponentMetadata = {
  group: '低代码组件',
  componentName: 'SearchHistoryList',
  title: '搜索历史列表',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  category: '信息展示',
  npm: {
    package: '@dckj-npm/dc-material',
    version: '0.1.275',
    exportName: 'SearchHistoryList',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        name: 'isLeftIcon',
        title: '左侧是否有图标',
        setter: 'BoolSetter',
        defaultValue: true,
      },
      {
        name: 'iconSrc',
        title: '图标',
        setter: 'StringSetter',
        defaultValue: '',
      },
      {
        name: 'dataList',
        title: '数据',
        setter: {
          componentName: 'SetterFormVariable',
          props: {
            attributes: [
              {
                label: '搜索历史项',
                value: 'dataList',
                children: [{ label: '内容', value: 'content' }],
              },
            ],
          },
        },
      },
      {
        name: 'isShowDelete',
        title: '是否可删除',
        setter: 'BoolSetter',
        defaultValue: true,
      },
    ],
    supports: {
      style: true,
    },
  },
}

const snippets: IPublicTypeSnippet[] = [
  {
    title: '搜索历史列表',
    screenshot: '',
    schema: {
      componentName: 'SearchHistoryList',
      props: {
        iconSrc: '',
        dataList: [],
        isShowDelete: true,
      },
      children: [
        {
          componentName: 'Image',
          props: {
            imgSrc: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
            key: 'image-1',
          },
        },
        {
          componentName: 'Image',
          props: {
            imgSrc: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
            key: 'image-2',
          },
        },
        {
          componentName: 'NextText',
          props: {
            type: 'h5',
            children: '这里是内容',
            key: `text-1`,
          },
        },
      ],
    },
  },
]

export default {
  ...SearchHistoryListMeta,
  snippets,
}
