import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { forwardRef } from 'react';
import { Grid } from '../../Grid';
import { OverflowTypography } from '../../OverflowTypography';
import { useHidePersonalData } from '../../personalDataSecurity';
import { Typography } from '../../Typography';
import { DEFAULT_LINK_BUTTON_NAME } from '../constants';
import { OrganizationData } from '../styles';
import { StyledButton, StyledMenuItem } from './styles';
export const OrganizationItem = forwardRef(({ onClick, selected, name, inn, kpp, linkButton, isHidePersonalData }, ref) => {
    const { name: buttonName = DEFAULT_LINK_BUTTON_NAME, ...linkButtonProps } = linkButton || {};
    const hidePersonalDataClassname = useHidePersonalData({
        isEnabled: isHidePersonalData,
    });
    return (_jsx(StyledMenuItem, { ref: ref, onClick: onClick, selected: selected, disableGutters: true, children: _jsxs(Grid, { container: true, rows: 1, children: [_jsx(OverflowTypography, { className: hidePersonalDataClassname, variant: "body1", component: "div", children: name }), _jsxs(OrganizationData, { container: true, spacing: 2, className: hidePersonalDataClassname, children: [inn && (_jsxs(Typography, { variant: "caption", color: "textSecondary", children: ["\u0418\u041D\u041D ", inn] })), kpp && (_jsxs(Typography, { variant: "caption", color: "textSecondary", children: ["\u041A\u041F\u041F ", kpp] }))] }), linkButton && (_jsx(StyledButton, { variant: "link", ...linkButtonProps, children: buttonName }))] }) }));
});
