c80fd0313c
Adds internationalization support in filters and origins pages by importing the useI18n function. Expands ESLint configuration to include new rules and plugins, ensuring improved code quality. Introduces Grafana monitoring plugin to enhance performance tracking capabilities in the application.
55 lines
1.1 KiB
TypeScript
55 lines
1.1 KiB
TypeScript
import { defineStore } from 'pinia'
|
|
import { ref } from 'vue'
|
|
|
|
import { Range } from '~/graphql/generated/operations'
|
|
|
|
export const useState = defineStore(
|
|
'state',
|
|
() => {
|
|
const title = ref<string>('')
|
|
const darkMode = ref(false)
|
|
const locale = ref('sv')
|
|
const range = ref<Range | undefined>(Range.OneWeek)
|
|
const search = ref('')
|
|
const includeHidden = ref(false)
|
|
const setTitle = (s: string) => {
|
|
title.value = s
|
|
}
|
|
const setDarkMode = (b: boolean) => {
|
|
darkMode.value = b
|
|
}
|
|
const setLocale = (l: string) => {
|
|
locale.value = l
|
|
}
|
|
const setSearch = (s: string) => {
|
|
search.value = s
|
|
}
|
|
const setIncludeHidden = (b: boolean) => {
|
|
includeHidden.value = b
|
|
}
|
|
const setRange = (r: Range | undefined) => {
|
|
range.value = r
|
|
}
|
|
return {
|
|
title,
|
|
darkMode,
|
|
locale,
|
|
search,
|
|
includeHidden,
|
|
range,
|
|
setTitle,
|
|
setDarkMode,
|
|
setLocale,
|
|
setSearch,
|
|
setIncludeHidden,
|
|
setRange,
|
|
}
|
|
},
|
|
{
|
|
persist: {
|
|
storage: localStorage,
|
|
key: 'dancefinder_state',
|
|
},
|
|
},
|
|
)
|