/**
* Company Query Hook
*
* Fetches a single company by ID using TanStack Query.
* Replaces CompanyRepository + GetCompanyUseCase pattern.
*
* @layer Presentation - Hooks
*/
import { useQuery } from '@tanstack/react-query';
import { companiesApi } from '@/infrastructure/http/api/company';
import { queryKeys } from '@/lib/query-keys';
/**
* useCompany
*
* Fetches and caches a single company by ID.
*
* @param companyId - Company UUID (optional for conditional fetching)
* @returns Query result with company data, loading, and error states
*
* @example
* ```typescript
* function CompanyProfile({ companyId }: { companyId: string }) {
* const { data: company, isLoading, error } = useCompany(companyId);
*
* if (isLoading) return