mirror of
https://github.com/upscayl/upscayl.git
synced 2025-02-15 10:22:37 +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;
|