import {Tooltip} from 'antd'
import {BankOutlined} from '@ant-design/icons'
import {Grid, GridItem} from './Grid'

export const CompanyView = ({company}) => {
  if(!company)
    return <Tooltip title='нет данных'>-</Tooltip>

  const displayName = company?.caption

  const tooltipInfo = <Grid columnGap='8px'>
    <GridItem row={1} col={1}>
      тип:
    </GridItem>
    <GridItem row={1} col={2}>
      {company?.companyTypeCaption}
    </GridItem>
  </Grid>

  return <Tooltip title={tooltipInfo}>
    <BankOutlined style={{marginRight:8}}/>
    {displayName}
  </Tooltip>
  
}