Files
Stirling-PDF/frontend/shared/components/MethodBadge.tsx
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
657 B
TypeScript
Raw Normal View History

2026-06-02 17:08:24 +01:00
import "@shared/components/MethodBadge.css";
export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
export interface MethodBadgeProps {
method: HttpMethod;
className?: string;
}
/**
* Method chip used in the docs and the pipeline row to label HTTP verbs.
* Colours match the prototype: GET green, POST blue, PUT amber, DELETE red.
*/
export function MethodBadge({ method, className }: MethodBadgeProps) {
return (
<span
className={[
"sui-method",
`sui-method--${method.toLowerCase()}`,
className ?? "",
]
.filter(Boolean)
.join(" ")}
>
{method}
</span>
);
}