https://dev.kronoz.win/r/marzneshin.git
| 1 |
4708fcb |
Dawsh |
2y ago |
import { createContext, useContext } from "react"; |
| 2 |
7738ec1 |
Mardin |
2y ago |
import { AdminType } from "@marzneshin/modules/admins"; |
| 3 |
4708fcb |
Dawsh |
2y ago |
|
| 4 |
4708fcb |
Dawsh |
2y ago |
interface RouterAdminContextProps { |
| 5 |
4708fcb |
Dawsh |
2y ago |
admin: AdminType | null; |
| 6 |
4708fcb |
Dawsh |
2y ago |
isPending?: boolean; |
| 7 |
4708fcb |
Dawsh |
2y ago |
} |
| 8 |
4708fcb |
Dawsh |
2y ago |
|
| 9 |
4708fcb |
Dawsh |
2y ago |
export const RouterAdminContext = createContext<RouterAdminContextProps | null>(null); |
| 10 |
4708fcb |
Dawsh |
2y ago |
|
| 11 |
4708fcb |
Dawsh |
2y ago |
export const useRouterAdminContext = () => { |
| 12 |
4708fcb |
Dawsh |
2y ago |
const ctx = useContext(RouterAdminContext); |
| 13 |
4708fcb |
Dawsh |
2y ago |
return ctx; |
| 14 |
4708fcb |
Dawsh |
2y ago |
}; |