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

const PisellAppVersionControlMeta = {
  componentName: 'AppVersionControl',
  title: '应用版本控制',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/materials',
    version: '1.0.3',
    exportName: 'AppVersionControl',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  props: [
    {
      title: {
        label: {
          type: 'i18n',
          'en-US': 'allowPublish',
          'zh-CN': '允许发布',
        },
      },
      name: 'allowPublish',
      description: '是否允许发布版本',
      defaultValue: true,
      setter: 'BoolSetter',
    },
    {
      title: {
        label: {
          type: 'i18n',
          'en-US': 'allowCreate',
          'zh-CN': '允许创建',
        },
      },
      name: 'allowCreate',
      description: '是否允许创建新版本',
      defaultValue: true,
      setter: 'BoolSetter',
    },
  ],
  configure: {
    component: {
      isContainer: true,
    },
    supports: {
      style: true,
      className: true,
    },
  },
};

const snippets: IPublicTypeSnippet[] = [
  {
    title: '应用版本控制',
    screenshot: '',
    schema: {
      title: '应用版本控制',
      componentName: 'AppVersionControl',
      props: {
        allowPublish: true,
        allowCreate: true,
        value: '1.0.0',
        versions: [
          {
            version: '1.0.0',
            label: '初始版本',
            value: '1.0.0',
            status: 'live',
          },
          {
            version: '1.0.1',
            label: '新增功能',
            value: '1.0.1',
            status: 'draft',
          },
          
        ],
      },
    },
  },
];

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