import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2019-2025 GoodData Corporation
import { useMemo } from "react";
import { useIntl } from "react-intl";
import { ErrorComponent as DefaultError, newErrorMapping, } from "@gooddata/sdk-ui";
/**
 * @internal
 */
export function InsightError({ error, ErrorComponent = DefaultError, height, clientHeight, }) {
    const intl = useIntl();
    const errorMapping = useMemo(() => newErrorMapping(intl), [intl]);
    const errorProps = useMemo(() => errorMapping[error.getMessage()] ?? { message: error.message }, [errorMapping, error]);
    return _jsx(ErrorComponent, { ...errorProps, height: height, clientHeight: clientHeight });
}
//# sourceMappingURL=InsightError.js.map