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

const ProfileMeta: IPublicTypeComponentMetadata = {
  group: '低代码组件',
  componentName: 'Profile',
  title: '个人资料',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  category: '信息展示',
  npm: {
    package: '@dckj-npm/dc-material',
    version: '0.1.275',
    exportName: 'Profile',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: '数据源绑定',
        name: 'dataList',
        setter: {
          componentName: 'SetterFormVariable',
          props: {
            attributes: [
              {
                label: '个人数据',
                value: 'dataList',
                children: [
                  { label: '头像', value: 'headPath' },
                  { label: '名字', value: 'userName' },
                  { label: '电话', value: 'phone' },
                ],
              },
            ],
          },
        },
      },
    ],
    supports: {
      style: true,
      events: [
        {
          name: 'onClick',
          description: '点击事件',
        },
      ],
    },
    component: {
      disableBehaviors: ['copy'],
    },
  },
}

const snippets: IPublicTypeSnippet[] = [
  {
    title: '个人资料',
    screenshot: '',
    schema: {
      componentName: 'Profile',
      props: {
        dataList: {
          image:
            'https://51ymb.com/source/api/upload/1075055372064133120/2025/202502/20250218/1089219520733777920.png',
          userName: '张三',
          phone: '13819025571',
        },
      },
      children: [
        {
          componentName: 'NextText',
          props: {
            type: 'h5',
            children: '列表标题',
            key: 'userName',
            style: {
              fontSize: '16px',
              fontWeight: '700',
              color: '#222222',
            },
          },
        },
        {
          componentName: 'Image',
          props: {
            src:
              'https://51ymb.com/source/api/upload/1075055372064133120/2025/202502/20250218/1089219520733777920.png',
            key: 'image',
          },
        },
        {
          componentName: 'NextText',
          props: {
            type: 'h5',
            children: '13819025571',
            key: `phone`,
            style: {
              fontSize: '12px',
              lineHeight: '16px',
              color: '#222222',
            },
          },
        },
        {
          componentName: 'Button',
          props: {
            name: 'Edit',
            color: '#ffffff',
            style: {
              backgroundColor: '#FF4C3B',
              color: '#ffffff',
            },
            key: 'button',
          },
        },
      ],
    },
  },
]

export default {
  ...ProfileMeta,
  snippets,
}
