mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-08 05:56:38 +00:00
17 lines
476 B
TypeScript
17 lines
476 B
TypeScript
"use client";
|
|
|
|
import RemoteExitNodeContext from "@app/contexts/remoteExitNodeContext";
|
|
import { build } from "@server/build";
|
|
import { useContext } from "react";
|
|
|
|
export function useRemoteExitNodeContext() {
|
|
if (build == "oss") {
|
|
return null;
|
|
}
|
|
const context = useContext(RemoteExitNodeContext);
|
|
if (context === undefined) {
|
|
throw new Error("useRemoteExitNodeContext must be used within a RemoteExitNodeProvider");
|
|
}
|
|
return context;
|
|
}
|