export const useDirectusFiles = () => { const config = useRuntimeConfig(); const baseUrl = config.public.directus.url; const getFileUrl = ( id?: string | null, options?: Record ): string => { if (!id) return ''; const query = options ? '?' + new URLSearchParams( Object.entries(options).map(([key, value]) => [key, String(value)]) ).toString() : ''; return `${baseUrl}/assets/${id}${query}`; }; return { getFileUrl, }; };