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

/** 大屏（资源墙）专用页：仅资源墙子视图，顶栏左上角视图 Segmented 关闭 */
const Meta: ComponentMetadata = {
  componentName: 'PisellVenueWallPage',
  title: '预约大屏页面',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/private-materials',
    version: '3.4.86',
    exportName: 'PisellVenueWallPage',
    main: 'src/index.ts',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'bodyViewStorageKey',
            'zh-CN': '子视图持久化 key（可选，覆盖默认大屏分流）',
          },
        },
        name: 'bodyViewStorageKey',
        description:
          '不传则用内置 pisell-reservation.venue-wall-page.v1，与预约主列表 localStorage 隔离',
        setter: ['StringSetter', 'VariableSetter'],
      },
      {
        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: 'PisellVenueWallPage',
    },
  },
];

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