"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrganizationItem = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const Grid_1 = require("../../Grid");
const OverflowTypography_1 = require("../../OverflowTypography");
const personalDataSecurity_1 = require("../../personalDataSecurity");
const Typography_1 = require("../../Typography");
const constants_1 = require("../constants");
const styles_1 = require("../styles");
const styles_2 = require("./styles");
exports.OrganizationItem = (0, react_1.forwardRef)(({ onClick, selected, name, inn, kpp, linkButton, isHidePersonalData }, ref) => {
    const { name: buttonName = constants_1.DEFAULT_LINK_BUTTON_NAME, ...linkButtonProps } = linkButton || {};
    const hidePersonalDataClassname = (0, personalDataSecurity_1.useHidePersonalData)({
        isEnabled: isHidePersonalData,
    });
    return ((0, jsx_runtime_1.jsx)(styles_2.StyledMenuItem, { ref: ref, onClick: onClick, selected: selected, disableGutters: true, children: (0, jsx_runtime_1.jsxs)(Grid_1.Grid, { container: true, rows: 1, children: [(0, jsx_runtime_1.jsx)(OverflowTypography_1.OverflowTypography, { className: hidePersonalDataClassname, variant: "body1", component: "div", children: name }), (0, jsx_runtime_1.jsxs)(styles_1.OrganizationData, { container: true, spacing: 2, className: hidePersonalDataClassname, children: [inn && ((0, jsx_runtime_1.jsxs)(Typography_1.Typography, { variant: "caption", color: "textSecondary", children: ["\u0418\u041D\u041D ", inn] })), kpp && ((0, jsx_runtime_1.jsxs)(Typography_1.Typography, { variant: "caption", color: "textSecondary", children: ["\u041A\u041F\u041F ", kpp] }))] }), linkButton && ((0, jsx_runtime_1.jsx)(styles_2.StyledButton, { variant: "link", ...linkButtonProps, children: buttonName }))] }) }));
});
