import { formatUserRender } from '../../utils';

export interface ProxyUserProps {
  proxyItems: Record<string, any>[];
}

const ProxyUser = (props: ProxyUserProps) => {
  const { proxyItems } = props;
  return (
    <span>
      {proxyItems?.map((item) => {
        const { id, nameZh, name, account, nameEn, state } = item;
        return (
          <span key={`proxyUser_${id}`} style={{ display: 'inline-block', fontSize: 12 }}>
            {formatUserRender({
              nameZh: nameZh || name,
              account: account || nameEn || nameZh || name,
              state,
            })}
          </span>
        );
      })}
    </span>
  );
};

export default ProxyUser;
