import { ref } from 'vue'

export const loginStatusChanged = ref(false)

export const triggerLoginStatusChange = () => {
  loginStatusChanged.value = !loginStatusChanged.value
}

export const navigateToReaderEvent = ref(null)

export const triggerNavigateToReader = (payload) => {
  navigateToReaderEvent.value = { ...payload, _timestamp: Date.now() }
}

export const navigateToExamWithFileEvent = ref(null)

export const triggerNavigateToExamWithFile = (payload) => {
  navigateToExamWithFileEvent.value = { ...payload, _timestamp: Date.now() }
}

export default {
  loginStatusChanged,
  triggerLoginStatusChange,
  navigateToReaderEvent,
  triggerNavigateToReader,
  navigateToExamWithFileEvent,
  triggerNavigateToExamWithFile
}
