mirror of
https://github.com/upscayl/upscayl.git
synced 2025-02-21 13:09:35 +01:00
19 lines
459 B
TypeScript
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;
|