import { prefixSuffixService } from "@/user-management/services/api/prefixSuffixService";
import { useQuery } from "@tanstack/react-query";

export const useUnitConfiguration = (unitId: string, options?: { enabled?: boolean }) => {
  return useQuery({
    queryKey: ["unitConfig", unitId],
    queryFn: () => prefixSuffixService.getInternalConfig(unitId!),
    enabled: options?.enabled ?? !!unitId,
    staleTime: 0,
    gcTime: 0,
    refetchOnWindowFocus: true,
  });
};
