UNPKG

@equinor/fusion-react-ag-grid-person-cell

Version:

React component for displaying person details in AgGrid cell and PersonCard on cell hover

26 lines (25 loc) 881 B
import { personSortComparator } from './personSort'; import { PersonCellRender } from './PersonCellRender'; export const agGridPersonCell = (col) => { const { azureId, upn, dataSource, dataToSort, heading, subHeading, showAvatar, size } = col; return { cellRendererParams: { azureId: azureId, upn: upn, dataSource: dataSource, heading: heading, subHeading: subHeading, showAvatar: showAvatar, size: size, }, cellRenderer: PersonCellRender, comparator: dataToSort ? personSortComparator(dataToSort) : undefined, cellClass: Array.isArray(col.field) ? 'personnel-table-cell' : 'person-table-cell', cellStyle: { display: 'flex', alignItems: 'center', }, ...col, }; }; export default agGridPersonCell;