mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 17:26:23 +02:00
13 lines
434 B
TypeScript
13 lines
434 B
TypeScript
|
|
import { useContext } from "react";
|
||
|
|
import { PlatformContext, type PlatformContextValue } from "@/contexts/platform-context";
|
||
|
|
|
||
|
|
export function usePlatform(): Pick<PlatformContextValue, "isDesktop" | "isWeb"> {
|
||
|
|
const { isDesktop, isWeb } = useContext(PlatformContext);
|
||
|
|
return { isDesktop, isWeb };
|
||
|
|
}
|
||
|
|
|
||
|
|
export function useElectronAPI(): ElectronAPI | null {
|
||
|
|
const { electronAPI } = useContext(PlatformContext);
|
||
|
|
return electronAPI;
|
||
|
|
}
|