import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from "react";
import styled from "styled-components";
import { ValidationLevel } from "../../Common/IDesignValidationProvider";
import { NotificationRendering } from "./NotificationRendering";
import { NotificationType } from "../FormDesignConstants";
const ValidationErrorRenderingDiv = styled.div `
    position: absolute;
    bottom: 24px;
    left: 24px;
    display: flex;
    z-index: 200;
    > * {
        margin-right: 16px;
    }
`;
export class ValidationErrorRendering extends React.Component {
    render() {
        let errors = [];
        let warnings = [];
        this.props.validations.forEach((v) => {
            if (v.level === ValidationLevel.ERROR) {
                errors.push(v);
            }
            else if (v.level === ValidationLevel.WARNING) {
                warnings.push(v);
            }
        });
        return (_jsxs(ValidationErrorRenderingDiv, { children: [errors.length > 0 && _jsx(NotificationRendering, { messages: errors, type: NotificationType.ERROR }, void 0),
                warnings.length > 0 && _jsx(NotificationRendering, { messages: warnings, type: NotificationType.WARNING }, void 0)] }, void 0));
    }
}
//# sourceMappingURL=ValidationErrorRendering.js.map