/** * hooks.ts — Re-Export Hub (Company hooks removed in Phase 1C) * * This file re-exports all hooks from their dedicated modules so that * existing imports `from '@/api/hooks'` continue to work without change. */ import { useQuery } from '@tanstack/react-query'; // ── Re-exports from dedicated modules ── export * from './types'; export * from './auth'; export * from './users'; export * from './contacts'; export * from './roles'; export * from './groups'; export * from './audit'; export * from './notifications'; export * from './plugins'; export * from './settings'; export * from './attachments'; export * from './unifiedContacts'; export * from './automation'; // ── Search hook (uses dynamic import, kept inline) ── import type { SearchFilters, SearchResult } from './search'; export type { SearchResult, SearchFilters }; export function useGlobalSearch(query: string, filters: SearchFilters = {}) { return useQuery({ queryKey: ['globalSearch', query, filters], queryFn: async (): Promise => { if (!query.trim()) return []; const { search } = await import('@/api/search'); const response = await search(query, filters, 20); return response.results || []; }, enabled: query.trim().length > 0, staleTime: 30 * 1000, }); }