nexus/ui/src/hooks/useHardwareInfo.ts
Nexus Dev 2a47c60057 feat(30-02): API client, hook, ModeSelector, and HardwareSummaryStep
- Add ui/src/api/hardware.ts with fetchHardwareInfo, fetchNexusSettings, updateNexusSettings
- Add ui/src/hooks/useHardwareInfo.ts with useQuery wrapper
- Add queryKeys.hardware.info to ui/src/lib/queryKeys.ts
- Add ModeSelector with three-card layout and selected state styling
- Add HardwareSummaryStep with skeleton loading, tier-appropriate labels, privacy frame
2026-04-04 03:55:49 +00:00

14 lines
487 B
TypeScript

// [nexus] React Query hook for hardware detection data
import { useQuery } from "@tanstack/react-query";
import { fetchHardwareInfo, type HardwareInfo } from "../api/hardware";
import { queryKeys } from "../lib/queryKeys";
export function useHardwareInfo(enabled = true) {
return useQuery<HardwareInfo>({
queryKey: queryKeys.hardware.info,
queryFn: fetchHardwareInfo,
enabled,
staleTime: 5 * 60 * 1000, // 5 minutes — matches server cache TTL
retry: 1,
});
}