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

const CollapseSelectorItemMeta: IPublicTypeComponentMetadata = {
  componentName: 'CollapseSelectorItem',
  group: '低代码组件',
  title: '手风琴选择项',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  category: '布局容器类',
  npm: {
    package: '@dckj-npm/dc-material',
    version: '0.1.13',
    exportName: 'CollapseSelectorItem',
    main: 'src\\index.tsx',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: '标题',
        name: 'title',
        setter: {
          componentName: 'StringSetter',
          isRequired: true,
          initialValue: '选择项',
        },
      },
      {
        title: '唯一标识',
        name: 'key',
        setter: {
          componentName: 'StringSetter',
          isRequired: true,
          initialValue: () => {
            return `collapse-selector-item-${Math.floor(Math.random() * 10000)}`
          },
        },
      },
      {
        title: '图标',
        name: 'icon',
        setter: {
          componentName: 'StringSetter',
          isRequired: false,
          initialValue: '',
        },
      },
    ],
    supports: {
      style: true,
    },
    component: {
      isContainer: true,
      nestingRule: {
        parentWhitelist: ['CollapseSelector'],
      },
    },
  },
}

const snippets: IPublicTypeSnippet[] = [
  {
    title: '手风琴选择项',
    screenshot: '',
    schema: {
      componentName: 'CollapseSelectorItem',
      props: {
        title: '选择项',
        key: `collapse-selector-item-${Math.floor(Math.random() * 10000)}`,
      },
    },
  },
]

export default {
  ...CollapseSelectorItemMeta,
  snippets,
}
