mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-16 22:16:49 +01:00
13 lines
334 B
TypeScript
13 lines
334 B
TypeScript
import { useQuery } from '@tanstack/react-query';
|
|
import type { OsType } from '@tauri-apps/plugin-os';
|
|
import { type } from '@tauri-apps/plugin-os';
|
|
|
|
export function useOsInfo() {
|
|
return useQuery<{ osType: OsType }>({
|
|
queryKey: ['platform'],
|
|
queryFn: async () => {
|
|
return { osType: await type() };
|
|
},
|
|
}).data;
|
|
}
|