import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { OverflowTypography } from '../OverflowTypography';
import { Typography } from '../Typography';
import { cva } from '../utils/cva';
import { complianceStatusClassnames, complianceStatusColorClassnames, complianceStatusVariantClassnames, } from './constants';
import { EmptyIcon, Inner, Item, RejectIcon, StyledLoader, SuccessIcon, Wrapper, } from './styles';
const ICON_BY_STATUS = {
    default: _jsx(EmptyIcon, {}),
    success: _jsx(SuccessIcon, {}),
    reject: _jsx(RejectIcon, {}),
    loading: _jsx(StyledLoader, {}),
};
const complianceStatus = cva(complianceStatusClassnames.root, {
    variants: {
        backgroundColor: {
            grey: complianceStatusColorClassnames.grey,
            primary: complianceStatusColorClassnames.primary,
        },
        variant: {
            contained: complianceStatusVariantClassnames.contained,
            outlined: complianceStatusVariantClassnames.outlined,
            plain: complianceStatusVariantClassnames.plain,
        },
    },
});
export const ComplianceStatus = ({ title, itemsList, children, subtitle, backgroundColor = 'grey', variant = 'contained', }) => {
    return (_jsxs(Wrapper, { className: complianceStatus({ backgroundColor, variant }), children: [title && (_jsx(OverflowTypography, { className: complianceStatusClassnames.title, variant: "h6", component: "h4", children: title })), subtitle, _jsx(Inner, { className: complianceStatusClassnames.list, children: itemsList.map(({ text, status }, index) => (
                // biome-ignore lint/suspicious/noArrayIndexKey: Элементы статичны
                _jsxs(Item, { className: complianceStatusClassnames.item, children: [ICON_BY_STATUS[status], _jsx(Typography, { children: text })] }, index))) }), children] }));
};
