import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { useAtomValue } from 'jotai';
import { Panel } from '@redocly/theme/components/Panel/Panel';
import { Markdown as MarkdownWrapper } from '@redocly/theme/components/Markdown/Markdown';
import { DownloadSpecification } from '../Download/index.js';
import { Overview } from '../Overview/index.js';
import { LanguageList } from '../Language/index.js';
import { ServerList } from '../ServerList/index.js';
import { globalStoreAtom } from '../../jotai/store.js';
import { normalizeServers } from '../../utils/index.js';
import { mergeInMockServer } from '../../models/operation.js';
import { languageAtom } from '../../jotai/app.js';
import { useTranslate } from '../../hooks/index.js';
export const RightPanel = ({ item: { infoDefinition: info }, }) => {
    const translate = useTranslate();
    const { options: { hideDownloadButtons, mockServer }, parser: { definition, definitionUrl }, } = useAtomValue(globalStoreAtom);
    const { languages, activeLanguage } = useAtomValue(languageAtom);
    const servers = normalizeServers(definitionUrl, mergeInMockServer(definition.servers || [], mockServer));
    return (_jsxs(_Fragment, { children: [!hideDownloadButtons && (_jsx(Panel, { className: "panel-download", header: translate('openapi.download.description.title', 'Download OpenAPI description'), isExpandable: false, children: _jsx(DownloadSpecification, {}) })), (info?.license || info?.contact || info?.termsOfService) && (_jsx(Panel, { className: "panel-overview", header: translate('openapi.info.title', 'Overview'), isExpandable: false, children: _jsx(MarkdownWrapper, { children: _jsx(Overview, { info: info, translate: translate }) }) })), !!languages?.length && (_jsx(Panel, { className: "panel-language-list", header: translate('openapi.languages.title', 'Languages'), isExpandable: false, children: _jsx(LanguageList, { languages: languages, activeLanguage: activeLanguage }) })), !!servers.length && (_jsx(Panel, { className: "panel-servers-list", header: translate('openapi.servers.title', 'Servers'), isExpandable: false, children: _jsx(ServerList, { servers: servers, path: "/", translate: translate }) }))] }));
};
//# sourceMappingURL=RightPanel.js.map