Cross platform window controls

This commit is contained in:
Gregory Schier
2023-04-27 10:19:49 -07:00
parent 8dfd3579e4
commit 2a4889bc01
7 changed files with 39 additions and 5 deletions

View File

@@ -0,0 +1,12 @@
import { useQuery } from '@tanstack/react-query';
import type { OsType } from '@tauri-apps/api/os';
import { type } from '@tauri-apps/api/os';
export function useOsInfo() {
return useQuery<{ osType: OsType }>({
queryKey: ['platform'],
queryFn: async () => {
return { osType: await type() };
},
}).data;
}