const version = ref('')

export function useAppVersion() {
    async function load() {
        try {
            const api = useApi()
            const data = await api.get<{ version: string }>('/version', {}, { toast: false })
            version.value = data.version
        } catch {
            version.value = '?'
        }
    }

    return { version, load }
}
