mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Table: Fix image cell mode so that it works with value mappings (#28644)
This commit is contained in:
parent
63c230b670
commit
1e51d33d85
@ -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>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user