import { ComponentMetadata, Snippet } from '@alilc/lowcode-types';

const BigSaleMeta: ComponentMetadata = {
  componentName: 'BigSale',
  title: 'BigSale',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/private-materials',
    version: '6.11.229',
    exportName: 'BigSale',
    main: 'src/index.ts',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'osKey',
            'zh-CN': '实例标识',
          },
          tip: 'SalesSdk BookingTicket instance key',
        },
        name: 'osKey',
        setter: 'StringSetter',
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'orderId',
            'zh-CN': '订单 ID',
          },
        },
        name: 'orderId',
        setter: 'NumberSetter',
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'mode',
            'zh-CN': '业务模式',
          },
        },
        name: 'mode',
        setter: {
          componentName: 'SelectSetter',
          props: {
            options: [
              { label: 'ticket', value: 'ticket' },
              { label: 'retail', value: 'retail' },
            ],
          },
        },
        defaultValue: 'ticket',
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'template',
            'zh-CN': '布局模板',
          },
        },
        name: 'template',
        setter: {
          componentName: 'SelectSetter',
          props: {
            options: [
              { label: 'standard', value: 'standard' },
              { label: 'secondaryScreen', value: 'secondaryScreen' },
            ],
          },
        },
        defaultValue: 'standard',
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'productLoadParams',
            'zh-CN': '商品加载参数',
          },
        },
        name: 'productLoadParams',
        setter: ['JsonSetter', 'VariableSetter'],
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'secondaryScreenDisplay',
            'zh-CN': '副屏展示配置',
          },
        },
        name: 'secondaryScreenDisplay',
        setter: ['JsonSetter', 'VariableSetter'],
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'otherParams',
            'zh-CN': 'OS 参数',
          },
        },
        name: 'otherParams',
        setter: ['JsonSetter', 'VariableSetter'],
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'style',
            'zh-CN': '样式',
          },
        },
        name: 'style',
        setter: 'StyleSetter',
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'className',
            'zh-CN': '类名',
          },
        },
        name: 'className',
        setter: 'StringSetter',
      },
    ],
    component: {
      isContainer: false,
    },
    supports: {
      style: true,
      className: true,
    },
  },
};

const snippets: Snippet[] = [
  {
    title: 'BigSale',
    screenshot: '',
    schema: {
      componentName: 'BigSale',
      props: {
        osKey: 'big-sale',
        mode: 'ticket',
        template: 'standard',
      },
    },
  },
];

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