import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Dialog, DialogHeader, DialogBody, DialogContent } from '../../Dialog';
import { Overlay } from '../../Overlay';
import { ErrorPagination } from '../ErrorPagination/ErrorPagination';
import { ToolButtonsGroup } from '../../ToolButtonsGroup/ToolButtonsGroup';
import { VersionStalenessInfo } from '../../VersionStalenessInfo';
export function ErrorOverlayLayout(param) {
    let { errorMessage, errorType, children, errorCode, error, debugInfo, isBuildError, onClose, temporaryHeaderChildren, versionInfo, readyErrors, activeIdx, setActiveIndex } = param;
    return /*#__PURE__*/ _jsx(Overlay, {
        fixed: isBuildError,
        children: /*#__PURE__*/ _jsx(Dialog, {
            type: "error",
            "aria-labelledby": "nextjs__container_errors_label",
            "aria-describedby": "nextjs__container_errors_desc",
            onClose: onClose,
            children: /*#__PURE__*/ _jsxs(DialogContent, {
                children: [
                    /*#__PURE__*/ _jsxs(DialogHeader, {
                        className: "nextjs-container-errors-header",
                        children: [
                            /*#__PURE__*/ _jsx(ErrorPagination, {
                                readyErrors: readyErrors != null ? readyErrors : [],
                                activeIdx: activeIdx != null ? activeIdx : 0,
                                onActiveIndexChange: setActiveIndex != null ? setActiveIndex : ()=>{}
                            }),
                            /*#__PURE__*/ _jsxs("div", {
                                className: "nextjs__container_errors__error_title",
                                // allow assertion in tests before error rating is implemented
                                "data-nextjs-error-code": errorCode,
                                children: [
                                    /*#__PURE__*/ _jsx("h1", {
                                        id: "nextjs__container_errors_label",
                                        className: "nextjs__container_errors_label",
                                        children: errorType
                                    }),
                                    /*#__PURE__*/ _jsx(ToolButtonsGroup, {
                                        error: error,
                                        debugInfo: debugInfo
                                    })
                                ]
                            }),
                            /*#__PURE__*/ _jsx(VersionStalenessInfo, {
                                versionInfo: versionInfo
                            }),
                            /*#__PURE__*/ _jsx("p", {
                                id: "nextjs__container_errors_desc",
                                className: "nextjs__container_errors_desc",
                                children: errorMessage
                            }),
                            temporaryHeaderChildren
                        ]
                    }),
                    /*#__PURE__*/ _jsx(DialogBody, {
                        className: "nextjs-container-errors-body",
                        children: children
                    })
                ]
            })
        })
    });
}

//# sourceMappingURL=ErrorOverlayLayout.js.map