import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import "./style.scss";
import CheckboxComponent from "../../CheckboxComponent";
import CircularIcon from "../../CircularIcon";
import { ClickableText, EllipsisText, PrimaryButton } from "../..";
import IconButton from "../../IconButton";
import BadgeWithCount from "../../BadgeWithCount";
const PersonViewHeader = ({ profilePicture = "", fullName = "", id = "", currentRole = "", currentCompany = "", universalName = "", urn = "", location = "", lastUpdated = "", onCheckClick, onClose, onBack, onUpdateClick = () => { }, onCompanyNameClick, isThreeMonthsAgo = false, updateError = false, checkValue = false, addedAssignmentsCount, onAddToAssignmentClick = () => { }, onBadgeClick, createOrUpdateQuestRequest, viewInQuestButton, questRestrictionBadge, markFakeButton, socialLogos, questActivityButton, dataCy, assignmentNames, }) => {
    const tooltipContent = (_jsxs("div", { className: "personViewHeaderTooltipContent", children: [_jsxs("strong", { children: ["Added to ", addedAssignmentsCount, " assignments:"] }), assignmentNames && assignmentNames.length > 0 && (_jsx("div", { children: assignmentNames.map((name) => (_jsxs("div", { children: ["\u2022 ", name] }, name))) }))] }));
    return (_jsx("div", { children: _jsxs("div", { className: "personViewHeader--Generic", children: [_jsxs("span", { className: "personViewHeader--Left", children: [onBack && (_jsx(IconButton, { color: "gray", variant: "tertiary", iconType: "arrowLeft", sizeVariant: "xs", iconSize: "20", onClick: onBack, "data-cy": `${dataCy}-back` })), onCheckClick && (_jsx("div", { className: "personViewHeaderCheckBoxLeft", children: _jsx(CheckboxComponent, { sizeVariant: "sm", checked: checkValue, onClick: (flag) => {
                                    onCheckClick(flag);
                                }, dataCy: `${dataCy}-checkbox` }) })), _jsx(CircularIcon, { iconPath: profilePicture, iconSize: "80", altImageType: "profile" }, `${id}-${lastUpdated}`), _jsxs("div", { className: "personViewHeader--PersonDetails", children: [_jsxs("div", { className: "fullNameContainer", children: [_jsx(EllipsisText, { children: _jsx("span", { children: fullName }) }), Boolean(addedAssignmentsCount) && (_jsx(BadgeWithCount, { count: addedAssignmentsCount, iconType: "briefcase", iconSize: "16", toolTipPosition: "top", onClick: onBadgeClick, dataCy: `${dataCy}-briefcase`, toolTipContent: tooltipContent }))] }), _jsxs("div", { className: "questHeaderActions", children: [questActivityButton, questRestrictionBadge] }), _jsxs("div", { className: "titleContainer", children: [_jsx(EllipsisText, { children: currentRole }), !!currentCompany && (_jsxs(_Fragment, { children: ["at", _jsx("span", { onClick: () => onCompanyNameClick(universalName, urn), className: "personViewHeaderCompanyLink", "data-cy": `${dataCy}-company`, children: _jsx(EllipsisText, { children: currentCompany }) })] }))] }), _jsx("h3", { children: location }), _jsxs("div", { className: "questActions", children: [viewInQuestButton, createOrUpdateQuestRequest, socialLogos] }), _jsx("div", { className: "markFake", children: markFakeButton })] })] }), _jsx("div", { className: "personViewHeader--Right", children: _jsxs("div", { className: "personViewHeader--ButtonRight", children: [isThreeMonthsAgo && !updateError && (_jsx(ClickableText, { text: "Update available", onClick: onUpdateClick, sizeVariant: "sm", iconSize: "14", dataCy: `${dataCy}-update` })), !updateError && (_jsx("div", { className: "profileUpdateDetail", children: _jsx(PrimaryButton, { colorVariant: "orange", sizeVariant: "xs", text: "Save to Assignment", onClick: onAddToAssignmentClick, dataCy: `${dataCy}-save-to-assignment` }) })), onClose && (_jsx(IconButton, { iconType: "cross", iconSize: "20", onClick: onClose, className: "crossBtn", "data-cy": `${dataCy}-cross` }))] }) })] }) }));
};
export default PersonViewHeader;
