import * as React from "react"; import { cn } from "@/lib/utils"; import { Badge } from "@/components/ui/badge"; type Method = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; const METHOD_CLASS: Record = { GET: "bg-success-soft text-success", POST: "bg-accent-soft text-accent", PUT: "bg-warning-soft text-warning", PATCH: "bg-warning-soft text-warning", DELETE: "bg-danger-soft text-danger", }; export function Endpoint({ method, path, scope, status, className, }: { method: Method; path: string; /** Required API key scope, if any. */ scope?: string | null; status?: "Live" | "Coming soon"; className?: string; }) { return (
{method} {path} {scope ? ( scope {scope} ) : scope === null ? ( any valid key ) : null} {status ? ( {status} ) : null}
); }