mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-24 10:21:37 +01:00
Cross platform window controls
This commit is contained in:
12
src-web/hooks/useOsInfo.ts
Normal file
12
src-web/hooks/useOsInfo.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user