railyard/apps/relay/ui/app/context/autopilot-available.tsx
caelum0x 994f2d1a31 feat(relay): drop upstream marketing, Relay UI naming, pinned docs links, Autopilot off
README rewritten with engine features, not-available list and Apache-2.0
attribution (forked from TensorZero 2026.6.0). UI status indicator, logger
prefix and warnings renamed to Relay (RELAY_UI_LOG_LEVEL with legacy alias).
Help links resolve via docs-url.ts to pinned engine docs (VITE_RELAY_DOCS_URL
override); fixed SFT link. /autopilot always shows the unavailable page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 00:23:22 +03:00

38 lines
886 B
TypeScript

"use client";
/**
* Autopilot Available Context Provider
*
* This module provides a React Context for checking if autopilot is available.
* Relay does not offer Autopilot (it needs TensorZero's hosted service), so the
* root loader always provides `false` and Autopilot entry points stay hidden.
*
* @module autopilot-available
*/
import { createContext, use } from "react";
const AutopilotAvailableContext = createContext(false);
AutopilotAvailableContext.displayName = "AutopilotAvailableContext";
/**
* Hook to check if autopilot is available
*/
export function useAutopilotAvailable() {
return use(AutopilotAvailableContext);
}
export function AutopilotAvailableProvider({
children,
value,
}: {
children: React.ReactNode;
value: boolean;
}) {
return (
<AutopilotAvailableContext value={value}>
{children}
</AutopilotAvailableContext>
);
}