const usePopup = function () {
  const status = ref(false)

  function open(callback?: () => void) {
    status.value = true
    if (callback && typeof callback === 'function') {
      callback()
    }
  }

  function close(callback?: () => void) {
    status.value = false
    if (callback && typeof callback === 'function') {
      callback()
    }
  }

  return {
    status,
    open,
    close,
  }
}

export default usePopup
