The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
import React from "react";
import CopyButton from "@/components/shared/CopyButton";
import { EntityLink } from "@/components/shared/EntityLink";
import { cx } from "@/lib/cva.config";
import { DEFAULT_PROXY_ADMIN_USER_ID } from "@/utils/sentinels";
import DefaultProxyAdminTag from "./DefaultProxyAdminTag";
interface LabeledFieldProps {
label: string;
value: string;
icon?: React.ReactNode;
href?: string;
truncate?: boolean;
copyable?: boolean;
defaultUserIdCheck?: boolean;
}
export default function LabeledField({
label,
value,
icon,
href,
truncate = false,
copyable = false,
defaultUserIdCheck = false,
}: LabeledFieldProps) {
const isEmpty = !value;
const isDefaultUser = defaultUserIdCheck && value === DEFAULT_PROXY_ADMIN_USER_ID;
const displayValue = isEmpty ? "-" : value;
const isCopyable = copyable && !isEmpty && !isDefaultUser;
const isLink = href != null && !isEmpty && !isDefaultUser;
const valueEl = isDefaultUser ? (
<DefaultProxyAdminTag userId={value} />
) : (
<span className="inline-flex min-w-0 items-center gap-1">
{isLink ? (
<EntityLink href={href} className={cx(truncate && "max-w-40")}>
{displayValue}
</EntityLink>
) : (
<strong className={cx("font-semibold", truncate ? "block max-w-40 truncate" : "break-words")}>
{displayValue}
</strong>
)}
{isCopyable && <CopyButton value={value} label={`Copy ${label}`} />}
</span>
);
return (
<div className="min-w-0">
<div className="flex items-center gap-1 text-muted-foreground">
{icon}
<span className="text-xs tracking-wider uppercase">{label}</span>
</div>
<div className="min-w-0">{valueEl}</div>
</div>
);
}