Files
medusa-store/www/src/components/route-section.js
Sebastian Rindom 1e5a1398d8 hotfix: docs build (#198)
* fix: build

* fix: build

* fix: build

* fix: build
2021-03-10 16:15:06 +01:00

20 lines
439 B
JavaScript

import React from "react"
import { Flex, Box, Text } from "rebass"
const RouteSection = ({ basePath, path, method }) => {
path = path.replace(/{(.*?)}/g, ":$1")
return (
<Box py={2}>
<Flex fontFamily="monospace">
<Text mr={2} variant={`labels.${method}`}>
{method}
</Text>
<Text>{`${basePath}${path === "/" ? "" : path}`}</Text>
</Flex>
</Box>
)
}
export default RouteSection