https://dev.kronoz.win/r/marzneshin.git
| 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 |
}; |