1
0
mirror of synced 2026-01-01 09:04:46 -05:00
Files
docs/components/rest/CodeBlock.tsx
2022-03-04 21:24:46 +00:00

25 lines
560 B
TypeScript

import cx from 'classnames'
import styles from './CodeBlock.module.scss'
type Props = {
verb?: string
codeBlock: string
highlight?: string
}
export function CodeBlock({ verb, codeBlock, highlight }: Props) {
return (
<pre className={cx(styles.methodCodeBlock, 'rounded-1 border')} data-highlight={highlight}>
<code>
{verb && (
<span className="color-bg-accent-emphasis color-fg-on-emphasis rounded-1 text-uppercase">
{verb}
</span>
)}{' '}
{codeBlock}
</code>
</pre>
)
}