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

const Meta: ComponentMetadata = {
  componentName: 'PisellTopology',
  title: '设备拓扑',
  category: 'SaaS',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/private-materials',
    version: '3.4.86',
    exportName: 'PisellTopology',
    main: 'src/index.ts',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'mode',
            'zh-CN': '模式',
          },
        },
        name: 'mode',
        setter: {
          componentName: 'RadioGroupSetter',
          props: {
            options: [
              { label: 'read', value: 'read' },
              { label: 'edit', value: 'edit' },
            ],
          },
          initialValue: 'read',
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'floorPlanCode',
            'zh-CN': '平面图 code',
          },
        },
        name: 'floorPlanCode',
        setter: 'StringSetter',
        initialValue: 'pisell_topology',
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'floorPlanId',
            'zh-CN': '平面图 ID',
          },
        },
        name: 'floorPlanId',
        setter: 'NumberSetter',
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'overviewHud',
            'zh-CN': '显示总览 HUD',
          },
        },
        name: 'overviewHud',
        setter: 'BoolSetter',
        initialValue: true,
      },
    ],
    supports: {
      style: true,
    },
    component: {
      isContainer: true,
    },
  },
};

const snippets: Snippet[] = [
  {
    title: '设备拓扑',
    screenshot: '',
    schema: {
      componentName: 'PisellTopology',
      props: {
        mode: 'read',
        floorPlanCode: 'pisell_topology',
        style: {
          width: '100%',
          height: '100%',
          minHeight: 0,
        },
      },
    },
  },
];

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