import { defineComponent } from 'vue'
import { useUserStore } from '@/store/modules/user'

export default defineComponent({
  name: 'musicPreView',
  props: {
    item: {
      type: Object,
      default: () => {}
    }
  },
  setup(props, { emit }) {
    const userStore = useUserStore()
    const token = userStore.getToken
    const prefix = /(localhost|192)/.test(location.host) ? 'https://ponline.colexiu.com' : location.origin
    const src = prefix + `/orchestra-music-score/?_t=${Date.now()}&id=${props.item.id}&modelType=practice&modeType=json&Authorization=${token}`
    return () => (
      <div>
        <iframe width={'667px'} height={'375px'} frameborder="0" src={src}></iframe>
      </div>
    )
  }
})
