gitscope
← marzneshin / v0.6.0 / dashboard/src/features/hosts/router-context/index.ts
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/features/hosts/router-context/index.ts · TypeScript
Blame Raw
 1import { createContext, useContext } from "react";
 2import { HostType } from "@marzneshin/features/hosts";
 3
 4interface RouterHostContextProps {
 5    host: HostType;
 6}
 7
 8export const RouterHostContext = createContext<RouterHostContextProps | null>(null);
 9
10export const useRouterHostContext = () => {
11    const ctx = useContext(RouterHostContext);
12    return ctx;
13};