import { fetchJson } from './apiClient'; import { getDeviceId } from '../lib/device'; export type EmotionItem = Record; type EmotionResponse = { data?: EmotionItem[]; }; export async function fetchEmotions(eventToken: string, locale?: string) { const params = new URLSearchParams(); if (locale) params.set('locale', locale); const response = await fetchJson( `/api/v1/events/${encodeURIComponent(eventToken)}/emotions${params.toString() ? `?${params.toString()}` : ''}`, { headers: { 'X-Device-Id': getDeviceId(), }, } ); return response.data?.data ?? []; }