feat: make automatisch info available
This commit is contained in:
14
packages/web/src/hooks/useAutomatischInfo.ts
Normal file
14
packages/web/src/hooks/useAutomatischInfo.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as React from 'react';
|
||||
import { AutomatischInfoContext } from 'contexts/AutomatischInfo';
|
||||
|
||||
type UseAutomatischInfoReturn = {
|
||||
isCloud: boolean;
|
||||
};
|
||||
|
||||
export default function useAutomatischInfo(): UseAutomatischInfoReturn {
|
||||
const automatischInfoContext = React.useContext(AutomatischInfoContext);
|
||||
|
||||
return {
|
||||
isCloud: automatischInfoContext.isCloud,
|
||||
};
|
||||
}
|
7
packages/web/src/hooks/useCloud.ts
Normal file
7
packages/web/src/hooks/useCloud.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import useAutomatischInfo from './useAutomatischInfo';
|
||||
|
||||
export default function useCloud(): boolean {
|
||||
const { isCloud } = useAutomatischInfo();
|
||||
|
||||
return isCloud;
|
||||
}
|
Reference in New Issue
Block a user