import { ref, readonly } from 'vue'

export default () => {
  const pageTitle = ref()
  const back = ref(false)
  const actions = ref([])
  const trigClick = ref()

  const setClick = fn => trigClick.value = fn
  const setActions = acts => actions.value = acts
  const setPageTitle = t => pageTitle.value = t
  const setBack = b => back.value = b

  return {
    pageTitle: readonly(pageTitle),
    back: readonly(back),
    actions: readonly(actions),
    trigClick: readonly(trigClick),
    setPageTitle,
    setBack,
    setClick,
    setActions,
  }
}
