export type NarratorContext = | 'intro' | 'intro_sequence_1' | 'intro_sequence_2' | 'intro_sequence_3' | 'transition_projects' | 'transition_skills' | 'transition_testimonials' | 'transition_journey' | 'hint' | 'encouragement_25' | 'encouragement_50' | 'encouragement_75' | 'contact_unlocked' | 'welcome_back' export type HeroType = 'recruteur' | 'client' | 'dev' export interface NarratorTextData { context: string text: string variant: number hero_type: HeroType | null } interface NarratorTextResponse { data: NarratorTextData meta: { lang: string } } export function useFetchNarratorText() { const config = useRuntimeConfig() const { locale } = useI18n() async function fetchText(context: NarratorContext, heroType?: HeroType): Promise { try { const url = heroType ? `/narrator/${context}?hero=${heroType}` : `/narrator/${context}` const response = await $fetch(url, { baseURL: config.public.apiUrl as string, headers: { 'X-API-Key': config.public.apiKey as string, 'Accept-Language': locale.value, }, }) return response.data } catch { return null } } return { fetchText } }