export const useApi = () => { const config = useRuntimeConfig() const apiBase = config.public.apiBase const getErrorMessage = (err: unknown, fallback: string) => { const anyErr = err as { data?: { erreur?: string }; message?: string } if (anyErr?.data?.erreur) return anyErr.data.erreur if (anyErr?.message) return anyErr.message return fallback } return { apiBase, getErrorMessage } }