import type { TestimonialsResponse } from '~/types/testimonial'

export function useFetchTestimonials() {
  const config = useRuntimeConfig()
  const { locale } = useI18n()

  return useFetch<TestimonialsResponse>('/testimonials', {
    baseURL: config.public.apiUrl as string,
    headers: {
      'X-API-Key': config.public.apiKey as string,
      'Accept-Language': locale.value,
    },
    transform: (response) => response,
  })
}
