({ statusCodes, slug }: Props)
| 7 | } |
| 8 | |
| 9 | export function RestStatusCodes({ statusCodes, slug }: Props) { |
| 10 | const { t } = useTranslation('products') |
| 11 | |
| 12 | return ( |
| 13 | <> |
| 14 | <h3 className="mt-4 mb-3 pt-3 h4" id={`${slug}--status-codes`}> |
| 15 | <a href={`#${slug}--status-codes`}>{t('rest.reference.http_status_code')}</a> |
| 16 | </h3> |
| 17 | |
| 18 | <table> |
| 19 | <thead> |
| 20 | <tr className="text-left"> |
| 21 | <th>{t('rest.reference.status_code')}</th> |
| 22 | <th>{t('rest.reference.description')}</th> |
| 23 | </tr> |
| 24 | </thead> |
| 25 | <tbody> |
| 26 | {statusCodes.map((statusCode, index) => ( |
| 27 | <tr key={`${statusCode.description}-${index}}`}> |
| 28 | <td> |
| 29 | <code>{statusCode.httpStatusCode}</code> |
| 30 | </td> |
| 31 | <td> |
| 32 | {statusCode.description ? ( |
| 33 | <div dangerouslySetInnerHTML={{ __html: statusCode.description }} /> |
| 34 | ) : ( |
| 35 | statusCode.httpStatusMessage |
| 36 | )} |
| 37 | </td> |
| 38 | </tr> |
| 39 | ))} |
| 40 | </tbody> |
| 41 | </table> |
| 42 | </> |
| 43 | ) |
| 44 | } |
nothing calls this directly
no test coverage detected