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

/** 场控页面：仅平面图、锁日期导航、可调当日时刻、HUD 开表抽屉等（与预约 Core 同实现，默认 props 不同） */
const Meta: ComponentMetadata = {
  componentName: 'PisellVenueControlPage',
  title: '场控页面',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/private-materials',
    version: '3.4.86',
    exportName: 'PisellVenueControlPage',
    main: 'src/index.ts',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'onFloorMapBookingClick',
            'zh-CN': '平面图预约点击回调',
          },
        },
        name: 'onFloorMapBookingClick',
        setter: 'FunctionSetter',
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'scheduleStartSlot',
            'zh-CN': '顶栏左侧插槽',
          },
        },
        name: 'scheduleStartSlot',
        setter: 'SlotSetter',
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'scheduleEndSlot',
            'zh-CN': '顶栏右侧插槽',
          },
        },
        name: 'scheduleEndSlot',
        setter: 'SlotSetter',
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'timeNavigatorProps',
            'zh-CN': '时间轴透传属性',
          },
        },
        name: 'timeNavigatorProps',
        setter: ['JsonSetter', 'VariableSetter'],
      },
      {
        title: {
          label: { type: 'i18n', 'en-US': 'fab', 'zh-CN': '右下角悬浮区' },
        },
        name: 'fab',
        setter: 'SlotSetter',
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'gridDataSourceKey',
            'zh-CN': '平面图数据源 key',
          },
        },
        name: 'gridDataSourceKey',
        setter: ['StringSetter', 'VariableSetter'],
        defaultValue: 'tables',
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'dataSources',
            'zh-CN': '多数据源（含资源列表）',
          },
        },
        name: 'dataSources',
        setter: ['JsonSetter', 'VariableSetter'],
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'scheduleValue',
            'zh-CN': '顶栏日期+时刻（受控）',
          },
        },
        name: 'scheduleValue',
        setter: ['JsonSetter', 'VariableSetter'],
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'floorMap',
            'zh-CN': '平面图 props（合并默认）',
          },
        },
        name: 'floorMap',
        setter: ['JsonSetter', 'VariableSetter'],
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'floorPlanId',
            'zh-CN': '平面图后端 ID（保存时 PUT）',
          },
        },
        name: 'floorPlanId',
        setter: ['NumberSetter', 'VariableSetter'],
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'onFloorPlanPersisted',
            'zh-CN': '平面图保存成功回调',
          },
        },
        name: 'onFloorPlanPersisted',
        setter: 'FunctionSetter',
      },
      {
        title: {
          label: { type: 'i18n', 'en-US': 'pagination', 'zh-CN': '分页' },
        },
        name: 'pagination',
        setter: ['JsonSetter', 'VariableSetter'],
      },
      {
        title: {
          label: { type: 'i18n', 'en-US': 'loading', 'zh-CN': '加载中' },
        },
        name: 'loading',
        setter: ['BoolSetter', 'VariableSetter'],
        defaultValue: false,
      },
      {
        title: {
          label: { type: 'i18n', 'en-US': 'className', 'zh-CN': '类名' },
        },
        name: 'className',
        setter: ['StringSetter', 'VariableSetter'],
      },
      {
        title: { label: { type: 'i18n', 'en-US': 'style', 'zh-CN': '样式' } },
        name: 'style',
        setter: ['StyleSetter', 'VariableSetter'],
      },
    ],
    supports: {
      style: true,
      className: true,
    },
    component: {
      isContainer: false,
    },
  },
};

const snippets: Snippet[] = [
  {
    title: '场控页面',
    screenshot: '',
    schema: {
      componentName: 'PisellVenueControlPage',
    },
  },
];

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