import { ref } from 'vue'

export function useLiteraturePreview() {
  const previewPmid = ref<number | null>(null)
  const showPreview = ref(false)

  function openPreview(pmid: number) {
    previewPmid.value = pmid
    showPreview.value = true
  }

  function closePreview() {
    previewPmid.value = null
    showPreview.value = false
  }

  return { previewPmid, showPreview, openPreview, closePreview }
}
