<script setup lang="ts">
import type { PageDataResourceGroup } from '#layers/types/api/pageData'

const props = defineProps<{
  resourcesData: PageDataResourceGroup
  pageVerTmplSeq: number
}>()
const { useAnalyticsLogData } = useAnalytics()
const logData = useAnalyticsLogData(props.resourcesData, props.pageVerTmplSeq)

// YouTube 모달 스토어 사용
const modalStore = useModalStore()

// 비디오 플레이 버튼 클릭 핸들러
const handleVideoPlayClick = () => {
  const youtubeUrl = props.resourcesData?.display?.text ?? ''
  modalStore.handleOpenYoutube({ youtubeUrl })
}
</script>

<template>
  <AtomsButtonPlay
    :resources-data="resourcesData"
    @click="handleVideoPlayClick"
  />
</template>
