- Introduced a comprehensive README.md detailing the application, its architecture, and key features. - Implemented a local-first architecture with deep research capabilities, including query decomposition and parallel web scraping. - Added a reactive UI built with React and Next.js, featuring Tailwind CSS for styling and Zustand for state management. - Integrated a task scheduler for recurring tasks and system monitoring for real-time resource management. - Enhanced settings page with debug mode options and improved hardware dashboard loading states. - Updated chat interface to include debug data visualization and improved user experience during message streaming. - Removed unused favicon and updated application icons for better branding. - Improved navigation handling with non-blocking transitions and state management for setup completion.
30 lines
712 B
TypeScript
30 lines
712 B
TypeScript
import { useState, useEffect } from 'react';
|
|
import { invoke } from '@tauri-apps/api/core';
|
|
import { SystemSpecs, GpuInfo } from '@/lib/recommendation';
|
|
|
|
export function useHardware() {
|
|
const [specs, setSpecs] = useState<SystemSpecs | null>(null);
|
|
const [loading, setLoading] = useState(true);
|
|
|
|
useEffect(() => {
|
|
async function fetchSpecs() {
|
|
try {
|
|
const data = await invoke<SystemSpecs>('get_system_specs');
|
|
setSpecs(data);
|
|
setLoading(false);
|
|
} catch (error) {
|
|
console.error("Failed to get system specs:", error);
|
|
setLoading(false);
|
|
}
|
|
}
|
|
fetchSpecs();
|
|
}, []);
|
|
|
|
return {
|
|
specs,
|
|
loading,
|
|
gpus: specs?.gpus || []
|
|
};
|
|
}
|
|
|