Spaces:
Sleeping
Sleeping
File size: 506 Bytes
5916048 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import classNames from "classnames";
export const Method = ({
method,
className,
}: {
method: string;
className?: string;
}) => (
<div
className={classNames(
`px-1 text-[10px] rounded text-slate-100 font-semibold inline-block ${className}`,
{
"bg-blue-500": method === "GET",
"bg-green-600": method === "POST",
"bg-yellow-600": method === "PUT" || method === "PATCH",
"bg-red-600": method === "DELETE",
}
)}
>
{method}
</div>
);
|