"use client";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export function ErrorFallback() {
    // Call resetErrorBoundary() to reset the error boundary and retry the render.
    return (_jsx("div", { role: "alert", children: _jsx("p", { children: "Something went wrong." }) }));
}
export function ErrorFallbackWithDetails({ error, component, editContext, }) {
    // Call resetErrorBoundary() to reset the error boundary and retry the render.
    return (_jsx("div", { role: "alert", className: "cursor-pointer", onClick: (ev) => {
            if (!editContext)
                return;
            ev.stopPropagation();
            ev.preventDefault();
            editContext.select([component.id]);
            if (!editContext.configuration.editor.views)
                return;
            if (component.rendering)
                editContext.switchWorkspace("component-designer");
        }, children: _jsxs("div", { className: "text-xs bg-gray-100 p-3", children: [_jsx("div", { className: "font-bold mb-1", children: "Something went wrong" }), _jsxs("div", { children: ["Component id: ", component.id] }), _jsxs("div", { children: ["Component type: ", component.type] }), component.rendering && (_jsxs("div", { children: ["Rendering id: ", component.rendering.id] })), _jsxs("pre", { className: "overflow-x-auto text-red-500 py-2", children: [error.message, " ", error.stack] })] }) }));
}
export function AsyncComponent() {
    return _jsx(ErrorFallback, {});
}
//# sourceMappingURL=Error.js.map