- 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
14 lines
487 B
TypeScript
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,
|
|
});
|
|
}
|