import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { CircularIcon, EllipsisText } from "..";
import { getFormatedDate } from "../../utils";
import TitleAtCompanyDescription from "./TitleAtCompanyDescription";
import "./style.scss";
const CompanyPeopleTab = ({ onNameClick, type, profiles, }) => {
    return (_jsx("div", { className: "companyPeopleTab-Container", children: profiles.map((profile) => {
            return (_jsxs("button", { onClick: () => onNameClick(profile), type: "button", className: "companyPeopleTab--Generic", children: [_jsx(CircularIcon, { altImageType: "profile", iconPath: profile.profileImg, iconSize: "48" }), _jsxs("div", { className: "companyPeopleTab-DetailsContainer", children: [_jsxs("div", { className: "companyPeopleTab-NameAndTitle", children: [_jsx("span", { className: "companyPeopleTab-Name", children: _jsx(EllipsisText, { children: profile.personName }) }), _jsx("span", { className: "companyPeopleTab-Title", children: type === "previous" ? (_jsxs(_Fragment, { children: [profile.pastTitle && (_jsx(TitleAtCompanyDescription, { company: profile.pastCompany, title: profile.pastTitle, isPreviousTitle: true })), profile.currentTitle && (_jsx(TitleAtCompanyDescription, { company: profile.currentCompany, title: profile.currentTitle }))] })) : (profile.currentTitle && (_jsx(TitleAtCompanyDescription, { company: profile.currentCompany, title: profile.currentTitle, showTitleReference: false }))) })] }), type === "previous" &&
                                profile.startOfTenure &&
                                profile.endOfTenure && (_jsx("div", { className: "companyPeopleTab-DateContainer", children: `${getFormatedDate(profile.startOfTenure)} - ${getFormatedDate(profile.endOfTenure)}` }))] })] }, profile.esId));
        }) }));
};
export default CompanyPeopleTab;
