import { Box, Divider } from '@rocket.chat/fuselage'; import React, { FC } from 'react'; import { useTranslation } from '../../contexts/TranslationContext'; import { useAbsoluteUrl } from '../../contexts/ServerContext'; import { apiCurlGetter } from './helpers'; type APIsDisplayProps = { apis: { path: string; computedPath: string; methods: unknown[]; examples: Record; }[]; }; const APIsDisplay: FC = ({ apis }) => { const t = useTranslation(); const absoluteUrl = useAbsoluteUrl(); const getApiCurl = apiCurlGetter(absoluteUrl); return <> {t('APIs')} {apis.map((api) => {api.methods.join(' | ').toUpperCase()} {api.path} {api.methods.map((method) =>

						{getApiCurl(method, api).map((curlAddress) => <>{curlAddress}
)}
)}
)}
; }; export default APIsDisplay;