import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { memo } from 'react';
import { HeadersCaption, StyledHeadersProperties } from './styled.js';
import { PropertyDetails } from '../PropertyDetails/index.js';
import { LinkToField } from '../common/LinkToField.js';
import { useTranslate } from '../../hooks/index.js';
function ResponseHeadersComponent({ headers, deepLink, }) {
    const translate = useTranslate();
    if (headers === undefined || headers.length === 0) {
        return null;
    }
    return (_jsxs(StyledHeadersProperties, { children: [_jsxs(HeadersCaption, { children: [deepLink && _jsx(LinkToField, { to: deepLink }), translate('openapi.header', 'Headers')] }), headers.map((field, index) => (_jsx(PropertyDetails, { isFirst: index === 0, field: field, disableDeepLinks: !deepLink }, field.name)))] }));
}
export const ResponseHeaders = memo(ResponseHeadersComponent);
//# sourceMappingURL=ResponseHeaders.js.map