pakt-api
Version:
This is a API HTML Documentation Generator
18 lines (17 loc) • 1.81 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.RouteDescriber = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const Request_1 = require("../request/Request");
const Response_1 = require("../response/Response");
const _styles_1 = require("./_styles");
const RouteDescriber = ({ route }) => {
const methodColor = {
GET: 'has-background-success',
POST: 'has-background-link',
PUT: 'has-background-warning',
DELETE: 'has-background-danger',
};
return ((0, jsx_runtime_1.jsxs)("div", { className: `m-3 has-radius-normal has-background-grey-darker ${_styles_1.styles.routeDescriber} route-describer`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-3 is-flex is-flex-direction-row is-align-items-center is-clickable collapser", children: [(0, jsx_runtime_1.jsx)("p", { className: `tag is-medium ${methodColor[route.method]} has-text-black-ter`, children: route.method }), (0, jsx_runtime_1.jsx)("h5", { className: "is-size-5 ml-3", style: { flex: 1 }, children: route.url }), (0, jsx_runtime_1.jsx)("figure", { className: "image is-24x24", children: (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", children: (0, jsx_runtime_1.jsx)("path", { fill: "#EBECF0", d: "M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z" }) }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: `${_styles_1.styles.collapsible} collapsible`, children: [route.request && (0, jsx_runtime_1.jsx)(Request_1.Request, { request: route.request }), (0, jsx_runtime_1.jsx)(Response_1.Response, { response: route.response })] })] }));
};
exports.RouteDescriber = RouteDescriber;
;