import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { memo } from 'react';
import { ResponseHeaders } from './ResponseHeaders.js';
import { StyledDescription } from './styled.js';
import { BodyContent } from '../common/BodyContent/index.js';
import { makeDeepLink } from '../../services/index.js';
function ResponseDetailsComponent({ response, operationId, callbackId, disableDeepLinks, }) {
    const { description, headers, content, summary, code } = response;
    return (_jsxs(_Fragment, { children: [_jsx(StyledDescription, { className: "redoc-markdown", source: summary }), _jsx(StyledDescription, { className: "redoc-markdown", source: description }), _jsx(ResponseHeaders, { headers: headers, deepLink: disableDeepLinks ? undefined : generateDeepLink(operationId, callbackId, code, 'headers') }), _jsx(BodyContent, { content: content, skipWriteOnly: true, deepLink: disableDeepLinks ? undefined : generateDeepLink(operationId, callbackId, code, 'body') })] }));
}
export const ResponseDetails = memo(ResponseDetailsComponent);
function generateDeepLink(operationId, callbackId = '', code, place) {
    const suffix = callbackId
        ? `${callbackId}/response&c=${code}/${place}`
        : `response&c=${code}/${place}`;
    return makeDeepLink(operationId, suffix);
}
//# sourceMappingURL=ResponseDetails.js.map