gitscope
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/modules/hosts/router-context/index.ts · v0.6.3
Source
1 03b3dbc Mardin 2y ago import { createContext, useContext } from "react";
2 d636f3f Dawsh 2y ago import { HostType } from "@marzneshin/modules/hosts";
3 03b3dbc Mardin 2y ago
4 03b3dbc Mardin 2y ago interface RouterHostContextProps {
5 03b3dbc Mardin 2y ago host: HostType;
6 03b3dbc Mardin 2y ago }
7 03b3dbc Mardin 2y ago
8 03b3dbc Mardin 2y ago export const RouterHostContext = createContext<RouterHostContextProps | null>(null);
9 03b3dbc Mardin 2y ago
10 03b3dbc Mardin 2y ago export const useRouterHostContext = () => {
11 03b3dbc Mardin 2y ago const ctx = useContext(RouterHostContext);
12 03b3dbc Mardin 2y ago return ctx;
13 03b3dbc Mardin 2y ago };