export const useProduct = (id: string) => { const { getDirectusLocale } = useLocalizations(); const locale = getDirectusLocale(); return useAsyncData(`product-${id}-${locale}`, async () => { try { const data = await $fetch(`/api/cms/product/${id}`, { headers: { 'x-locale': locale }, }); return data; } catch (error) { logger.error('Error fetching product: ', error); throw error; } }); };