import { EComponentType } from "@/consts/enum";
export function createComponentData(type: EComponentType): Record<string, any> | null {
  if(type === EComponentType.title){
    return {
      text: '默认标题',
      layout: 'left'
    }
  }
  if(type === EComponentType.text){
    return {
      text: '点击编辑输入您的文本内容',
      layout: 'left'
    }
  }
  if(type === EComponentType.link){
    return {
      link: '',
      layout: 'left',
      poster: '',
      linkType: '',
      text: '默认链接',
    }
  }
  
  if(type === EComponentType.wechatArticle){
    return {
      link: '',
      layout: 'left',
      poster: '',
      linkType: 'weixinOfficialAccountArticle',
      text: '公众号文章',
    }
  }
  if(type === EComponentType.tel){
    return {
      text: '默认电话',
      layout: 'left'
    }
  }
  if(type === EComponentType.address){
    return  {
      address: '默认地址',
      latitude: 39.916527,
      longitude:116.397128,
    }
  }
  // 图片/视频
  if(type === EComponentType.media){
    return  {
      media: [],
      layout: 'mini',
    }
  }
  // 小蓝本
  if(type === EComponentType.bluebook){
    return  {
      values: [],
      layout: 'mini',
    }
  }
  // 微信公众号(文章)
  // wx.openOfficialAccountProfile 
  if(type === EComponentType.wechat){
    return  {
      value: '',
      text: '微信公众号',
      layout: 'left',
    }
  }

  // 视频号，与 普通媒体链接共用同个组件
  // editor-link-social
  if(type === EComponentType.shiping){
    return  {
      layout: 'left',
      value: '',
      text: '视频号',
    }
  }
  // 小程序
  // editor-mii-program
  if(type === EComponentType.miniProgram){
    return  {
      value: {
        name: '默认小程序',
        shortLink: '',
        poster: '',
      },
      layout: 'full',
    }
  }
  // 视频号视频
  // editor-channels
  if(type === EComponentType.shipingVideo){
    return  {
      value: {
        accountId: '',
        videoId: '',
        desc: '',
        poster: '',
      },
    }
  }



  return null
}