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

const EventResourceUsabilityMeta: IPublicTypeComponentMetadata = {
  componentName: 'EventResourceUsability',
  title: '资源余量卡片',
  category: '数据展示',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/private-materials',
    version: '1.0.4',
    exportName: 'EventResourceUsability',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: "卡片信息展示",
        display: "block",
        type: "group",
        items: [
          {
            name: 'showRemaining',
            title: { label: '显示余量', tip: 'showRemaining | 显示余量' },
            setter: 'BoolSetter',
          },
          {
            name: 'showTime',
            title: { label: '显示时间', tip: 'showTime | 显示时间' },
            setter: 'BoolSetter',
          },
        ]
      },
    ],
    supports: {
      style: true,
      events: [
        {
          name: 'onTimeSlotClick',
          description: '点击时间段时触发',
        },
      ],
    },
  },
};

const snippets: IPublicTypeSnippet[] = [
  {
    title: '资源余量卡片',
    screenshot: '',
    schema: {
      componentName: 'EventResourceUsability',
      props: {
        showRemaining: true,
        showTime: true,
      },
    },
  },
];

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