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

/**
 * OrderList 组件 LowCode Meta 配置
 * @description 订单列表组件，集成了数据源容器、表格展示、筛选、排序、分页等功能
 */
const OrderListMeta: ComponentMetadata = {
  componentName: 'OrderList',
  title: '订单列表',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/private-materials',
    version: '1.0.4',
    exportName: 'OrderList',
    main: 'src/index.ts',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'business_code',
            'zh-CN': '业务代码',
          },
        },
        name: 'business_code',
        description: '业务代码，用于标识订单所属的业务类型',
        setter: ['StringSetter', 'VariableSetter'],
        isRequired: true,
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'className',
            'zh-CN': '类名',
          },
        },
        name: 'className',
        description: '自定义类名',
        setter: ['StringSetter', 'VariableSetter'],
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'style',
            'zh-CN': '样式',
          },
        },
        name: 'style',
        description: '自定义样式',
        setter: ['StyleSetter', 'VariableSetter'],
      },
    ],
    supports: {
      style: true,
      className: true,
    },
    component: {
      isContainer: false,
    },
  },
};

const snippets: Snippet[] = [
  {
    title: '订单列表',
    screenshot: '',
    schema: {
      componentName: 'OrderList',
      props: {
        business_code: 'default_business',
      },
    },
  },
];

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