<template>
  <PromptDetailContent
    :template="template"
    :show-header="isMobile"
    :show-dismiss-button="!isMobile"
    @back="handleBack"
    @use="handleUse"
    @dismiss="handleDismiss"
  />
</template>

<script setup lang="ts">
import PromptDetailContent from './PromptDetailContent.vue'
import type { Prompt } from '@/types/prompt'

// Props
defineProps<{
  template: Prompt
  isMobile?: boolean
}>()

// Emits
const emit = defineEmits<{
  (e: 'back'): void
  (e: 'use', template: Prompt): void
  (e: 'dismiss'): void
}>()

// Methods
function handleBack() {
  emit('back')
}

function handleUse(template: Prompt) {
  emit('use', template)
}

function handleDismiss() {
  emit('dismiss')
}
</script>
