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

const EventProductCardMeta: IPublicTypeComponentMetadata = {
  componentName: 'EventProductCard',
  title: '商品卡片',
  category: '数据展示',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/private-materials',
    version: '1.0.4',
    exportName: 'EventProductCard',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: "卡片信息展示",
        display: "block",
        type: "group",
        items: [
          {
            name: 'showImage',
            title: { label: '显示图片', tip: 'showImage | 显示图片' },
            setter: 'BoolSetter',
          },
          {
            name: 'showPrice',
            title: { label: '显示价格', tip: 'showPrice | 显示价格' },
            setter: 'BoolSetter',
          },
          {
            name: 'showName',
            title: { label: '商品名称', tip: 'showName | 商品名称' },
            setter: 'BoolSetter',
          },
          {
            name: 'showArrow',
            title: { label: '箭头', tip: 'showArrow | 箭头' },
            setter: 'BoolSetter',
          },
        ]
      },
    ],
    supports: {
      style: true,
      events: [
        {
          name: 'onClick',
          description: '点击卡片时触发',
        },
      ],
    },
  },
};

const snippets: IPublicTypeSnippet[] = [
  {
    title: '商品卡片',
    screenshot: '',
    schema: {
      componentName: 'EventProductCard',
      props: {
        showImage: true,
        showName: true,
        showPrice: true,
        showArrow: true,
      },
    },
  },
];

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