export const useVersions = async () => {
  const { apiBase } = useApi()

  const frontend = '0.1.0'
  let backend = 'unknown'

  try {
    const data = await $fetch<{ version?: string }>(`${apiBase}/healthz`)
    if (data?.version) {
      backend = data.version
    }
  } catch {
    // ignore
  }

  return { frontend, backend }
}
