Table: Fix image cell mode so that it works with value mappings (#28644)

This commit is contained in:
Torkel Ödegaard 2020-10-29 13:53:08 +01:00 committed by GitHub
parent 63c230b670
commit 1e51d33d85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,11 +2,13 @@ import React, { FC } from 'react';
import { TableCellProps } from './types'; import { TableCellProps } from './types';
export const ImageCell: FC<TableCellProps> = props => { export const ImageCell: FC<TableCellProps> = props => {
const { cell, tableStyles, cellProps } = props; const { field, cell, tableStyles, cellProps } = props;
const displayValue = field.display!(cell.value);
return ( return (
<div {...cellProps} className={tableStyles.cellContainer}> <div {...cellProps} className={tableStyles.cellContainer}>
<img src={cell.value} className={tableStyles.imageCell} /> <img src={displayValue.text} className={tableStyles.imageCell} />
</div> </div>
); );
}; };