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

25 lines
709 B
TypeScript

import { CodeResponse } from './types'
import { CodeBlock } from './CodeBlock'
type Props = {
responses: Array<CodeResponse>
}
export function RestResponse({ responses }: Props) {
return (
<>
{responses.map((response: CodeResponse, index: number) => {
return (
<div key={`${response.httpStatusMessage}-${index}}`}>
<h4 dangerouslySetInnerHTML={{ __html: response.description }} />
<CodeBlock
codeBlock={`Status: ${response.httpStatusCode} ${response.httpStatusMessage}`}
/>
{response.payload ? <CodeBlock codeBlock={response.payload} highlight="json" /> : null}
</div>
)
})}
</>
)
}