import { defineStore } from 'pinia'
import { ref } from 'vue'
import { moods } from '../shared/moods.ts'
import type { Mood } from '../shared/moods.ts'

export const useMoodStore = defineStore('mood', () => {
  const mood = ref<Mood>(moods.happy)
  const note = ref('')

  const changeMood = (newMood : Mood) => {
    mood.value = newMood
  }

  const changeNote = (newNote ?: string) => {
    note.value = newNote ?? ''
  }

  return {
    mood,
    note,
    changeMood,
    changeNote,
  }
})