nexus/ui/src/hooks/useHardwareInfo.ts
Nexus Dev 8f97e69184 feat(39-02): VoiceStep hardware-aware UI with conditional enable/skip
- Add VoiceCapability interface to ui/src/api/hardware.ts
- Export VoiceCapability type from useHardwareInfo.ts
- VoiceStep accepts voiceCapability prop, renders conditionally
- Insufficient hardware: shows capability note with skip-only button
- Binaries present: shows green checkmarks next to STT/TTS labels
- Missing binaries on sufficient hardware: shows install note, dimmed Enable
- NexusOnboardingWizard passes voiceCapability from hardware probe to VoiceStep
2026-04-04 03:55:50 +00:00

16 lines
543 B
TypeScript

// [nexus] React Query hook for hardware detection data
import { useQuery } from "@tanstack/react-query";
import { fetchHardwareInfo, type HardwareInfo, type VoiceCapability } from "../api/hardware";
import { queryKeys } from "../lib/queryKeys";
export type { VoiceCapability };
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,
});
}