import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { Alert } from '@cube-dev/ui-kit';
import { useQueryBuilderContext } from './context';
export function QueryBuilderError() {
    const { verificationError, error, isVerifying, usedCubes } = useQueryBuilderContext();
    if (!usedCubes?.length) {
        return null;
    }
    return (_jsxs(_Fragment, { children: [verificationError && !verificationError.toString().includes('Values required for filter') ? (_jsx(Alert, { theme: "note", padding: "1x", opacity: isVerifying ? '.5' : 1, children: verificationError.toString().replace('Error: Error: ', '') })) : null, error ? (_jsx(Alert, { theme: "danger", padding: "1x", children: error.toString().replace('Error: Error: ', '') })) : null] }));
}
//# sourceMappingURL=QueryBuilderError.js.map