import { buildProps } from '@kankan-components/utils'
import type { ExtractPropTypes, PropType } from 'vue'
import type { TagItemType } from './tagItem'

type SourceType = {
    src: string
}

export interface Tag {
    content: string
    createTime: EpochTimeStamp
    floorIndex: number
    icon: string
    panoId: string
    position: {
        x: number
        y: number
        z: number
    }
    media: {
        image?: SourceType[]
        video?: SourceType[]
    }
    sid: string
    title: string
    type: TagItemType
    visible: boolean
    x: number
    y: number
    visiblePanos?: any[]
}

export const tagProps = buildProps({
    tag: {
        type: Object as PropType<Tag>,
        required: true,
    },
} as const)
export type TagProps = ExtractPropTypes<typeof tagProps>

export const tagEmits = {
    click: () => true,
    mouseEnter: () => true,
    mouseLeave: () => true,
}
export type TagEmits = typeof tagEmits
