1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-02-15 10:22:37 +01:00
upscayl/renderer/components/hooks/use-system-info.ts
2024-12-20 09:33:28 +05:30

19 lines
459 B
TypeScript

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;