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

export type TagItemType = 'image' | 'video' | 'link'

export const tagItemProps = buildProps({
  id: {
    type: String,
    default: '',
    required: true,
  },
  title: {
    type: String,
    default: '',
    required: true,
  },
  type: {
    type: String as PropType<TagItemType>,
    default: '',
    required: true,
  },
  media: {
    type: Object as PropType<Tag['media']>,
    default: null,
  },
  content: {
    type: String,
    default: '',
    required: true,
  },
} as const)
export type TagItemProps = ExtractPropTypes<typeof tagItemProps>
