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

(cherry picked from commit 1e51d33d85)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
This commit is contained in:
Grot (@grafanabot)
2020-10-29 14:58:38 +01:00
committed by GitHub
co-authored by Torkel Ödegaard
parent 4f4fcf6331
commit 4ff80d541b
@@ -2,11 +2,13 @@ import React, { FC } from 'react';
import { TableCellProps } from './types';
export const ImageCell: FC<TableCellProps> = props => {
const { cell, tableStyles, cellProps } = props;
const { field, cell, tableStyles, cellProps } = props;
const displayValue = field.display!(cell.value);
return (
<div {...cellProps} className={tableStyles.cellContainer}>
<img src={cell.value} className={tableStyles.imageCell} />
<img src={displayValue.text} className={tableStyles.imageCell} />
</div>
);
};