import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { CircularIcon } from "..";
import { capitalizeAllFirstAlphabets } from "../../utils";
import "./style.scss";
const CompetitorsCompanyTab = ({ onNameClick, competitors, }) => {
    const getCompanyContent = (competitor) => `${competitor.companyLocation &&
        capitalizeAllFirstAlphabets(competitor.companyLocation)}${competitor.companyLocation && !!competitor.employeeCount ? " • " : ""}${!!competitor.employeeCount
        ? competitor.employeeCount?.toLocaleString("en-US") + " Employees"
        : ""}`;
    return (_jsx("div", { className: "competitorsTabWrapper", children: competitors.map((competitor) => {
            return (_jsxs("button", { onClick: () => onNameClick(competitor?.universalName), className: "competitorsTab", children: [_jsx("div", { className: "companyIcon", children: _jsx(CircularIcon, { altImageType: "company", iconPath: competitor.imageUrl, iconSize: "48" }) }), _jsxs("div", { className: "companyDetails", children: [_jsx("h3", { children: capitalizeAllFirstAlphabets(competitor.companyTitle) }), getCompanyContent(competitor) ? (_jsx("p", { className: "companyLocation", children: getCompanyContent(competitor) })) : null] })] }));
        }) }));
};
export default CompetitorsCompanyTab;
