1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-02-21 13:09:35 +01:00
upscayl/renderer/components/hooks/use-system-info.ts

19 lines
459 B
TypeScript
Raw Normal View History

2024-12-20 09:33:28 +05:30
import { useEffect, useState } from "react";
const useSystemInfo = () => {
const [systemInfo, setSystemInfo] = useState<Awaited<
ReturnType<typeof window.electron.getSystemInfo>
> | null>(null);
useEffect(() => {
const getSystemInfo = async () => {
const systemInfo = await window.electron.getSystemInfo();
setSystemInfo(systemInfo);
};
getSystemInfo();
}, []);
return { systemInfo };
};
export default useSystemInfo;