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

/** 预约页面（原 PisellReservation 页面能力） */
const Meta: ComponentMetadata = {
  componentName: 'PisellReservationBookingPage',
  title: '预约页面',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/private-materials',
    version: '3.4.86',
    exportName: 'PisellReservationBookingPage',
    main: 'src/index.ts',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'floorMapBookingClickMode',
            'zh-CN': '平面图只读点击',
          },
        },
        name: 'floorMapBookingClickMode',
        description:
          'hostDrawer：引擎结账抽屉；detailModal：内置预约详情弹窗（纯展示）',
        setter: {
          componentName: 'RadioGroupSetter',
          props: {
            options: [
              { label: 'hostDrawer', value: 'hostDrawer' },
              { label: 'detailModal', value: 'detailModal' },
            ],
          },
          initialValue: 'detailModal',
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'onFloorMapBookingClick',
            'zh-CN': '平面图预约点击回调',
          },
        },
        name: 'onFloorMapBookingClick',
        description: '返回 true 可完全接管点击，不走内置抽屉/弹窗',
        setter: 'FunctionSetter',
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'onNewReservation',
            'zh-CN': '新建回调',
          },
        },
        name: 'onNewReservation',
        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',
        description:
          '透传 PisellTimeNavigator；开启「跟随当前」时组件会强制隐藏 Now 按钮',
        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',
        description: '未传默认 1；传 null 关闭 GET/PUT',
        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': 'variant', 'zh-CN': '布局变体' },
        },
        name: 'variant',
        description:
          '传 phone 启用手机优化布局（紧凑工具栏、顶栏折行等）；其它取值保留扩展',
        setter: ['StringSetter', 'VariableSetter'],
      },
      {
        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: 'PisellReservationBookingPage',
    },
  },
];

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