gitscope
← marzneshin / v0.5.3 / dashboard/src/features/services/contexts/router-context.ts
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/features/services/contexts/router-context.ts · TypeScript
Blame Raw
 1import { createContext, useContext } from "react";
 2import { ServiceType } from "@marzneshin/features/services";
 3
 4interface RouterServiceContextProps {
 5    service: ServiceType;
 6}
 7
 8export const RouterServiceContext = createContext<RouterServiceContextProps | null>(null);
 9
10export const useRouterServiceContext = () => {
11    const ctx = useContext(RouterServiceContext);
12    return ctx;
13};