- 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
16 lines
543 B
TypeScript
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,
|
|
});
|
|
}
|