import React from 'react';
import { checkMatchRuleSummaryRelevance } from '@reltio/mdm-sdk';
import classnames from 'classnames';
import Divider from '@mui/material/Divider';
import { ProfileCard } from '../ProfileCard';
import { MatchRulesBlock } from '../MatchRulesBlock';
import { RelevanceScoreBadge } from '../RelevanceScoreBadge';
import { useStyles } from './styles';
export var ProfileMatchCard = function (_a) {
    var _b;
    var children = _a.children, entitiesMap = _a.entitiesMap, entity = _a.entity, match = _a.match, metadata = _a.metadata, className = _a.className;
    var styles = useStyles();
    var showRelevanceBadge = (_b = match.matchRuleSummaries) === null || _b === void 0 ? void 0 : _b.some(checkMatchRuleSummaryRelevance);
    return (React.createElement("div", { "data-reltio-id": "profile-match-card", className: classnames(styles.root, className) },
        React.createElement("div", { className: styles.profileCardWrapper },
            React.createElement(ProfileCard, { entity: match.object, classes: { container: styles.profileCardContainer } }),
            children),
        React.createElement("div", { className: styles.rulesContainer },
            match.matchRules && (React.createElement(MatchRulesBlock, { match: match, metadata: metadata, entitiesMap: entitiesMap, entity: entity })),
            showRelevanceBadge && (React.createElement(React.Fragment, null,
                React.createElement("div", { className: styles.dividerWrapper },
                    React.createElement(Divider, { orientation: "vertical", className: styles.divider })),
                React.createElement(RelevanceScoreBadge, { className: styles.relevanceBadge, matchRuleSummaries: match.matchRuleSummaries }))))));
};
