import { RestOperationHeading } from './RestOperationHeading' import { RestHTTPMethod } from './RestHTTPMethod' import { RestParameterTable } from './RestParameterTable' import { RestCodeSamples } from './RestCodeSamples' import { RestResponse } from './RestResponse' import { Operation } from './types' import { RestNotes } from './RestNotes' import { RestPreviewNotice } from './RestPreviewNotice' type Props = { operation: Operation index: number } export function RestOperation({ operation }: Props) { const previews = operation['x-github'].previews const hasRequiredPreviews = previews ? previews.filter((preview) => preview.required).length > 0 : false return (
{operation.parameters && ( )} {operation['x-codeSamples'] && operation['x-codeSamples'].length > 0 && ( )} {(operation.notes.length > 0 || operation['x-github'].enabledForGitHubApps) && ( )} {previews && ( )}
) }