import { useMemo } from "react"; import classNames from "classnames"; import { Method } from "@/components/method"; import { splitStringBracket } from "@/utils"; import { ApiRoute } from "@/utils/type"; export const Endpoint = ({ endpoint, children, }: { endpoint: ApiRoute; children: React.ReactElement; }) => { const path_formatted = useMemo( () => splitStringBracket(endpoint.path), [endpoint.path] ); return (
{path_formatted.map((p, i) => { const isCustomizable = p.includes("{") && p.includes("}"); return (

{p}

); })}
{children}
); };