@@ -6,7 +6,7 @@ import { Button } from '@deephaven/components';
66import Log from '@deephaven/log' ;
77import type { VariableDefinition } from '@deephaven/jsapi-types' ;
88import classNames from 'classnames' ;
9- import { Code , ObjectIcon } from '../common' ;
9+ import { Code } from '../common' ;
1010import ConsoleHistoryItemResult from './ConsoleHistoryItemResult' ;
1111import ConsoleHistoryResultInProgress from './ConsoleHistoryResultInProgress' ;
1212import ConsoleHistoryResultErrorMessage from './ConsoleHistoryResultErrorMessage' ;
@@ -20,6 +20,10 @@ interface ConsoleHistoryItemProps {
2020 language : string ;
2121 openObject : ( object : VariableDefinition ) => void ;
2222 disabled ?: boolean ;
23+ // TODO: #1573 Remove this eslint disable
24+ // eslint-disable-next-line react/no-unused-prop-types
25+ supportsType : ( type : string ) => boolean ;
26+ iconForType : ( type : string ) => ReactElement ;
2327}
2428
2529class ConsoleHistoryItem extends PureComponent <
@@ -53,7 +57,7 @@ class ConsoleHistoryItem extends PureComponent<
5357 }
5458
5559 render ( ) : ReactElement {
56- const { disabled, item, language } = this . props ;
60+ const { disabled, item, language, iconForType } = this . props ;
5761 const { disabledObjects, result } = item ;
5862 const hasCommand = item . command != null && item . command !== '' ;
5963
@@ -77,6 +81,9 @@ class ConsoleHistoryItem extends PureComponent<
7781
7882 if ( changes ) {
7983 const { created, updated } = changes ;
84+ // TODO: #1573 filter for supported types or change button kind
85+ // based on if type is supported. Possibly a warn state for widgets
86+ // that the UI doesn't have anything registered to support.
8087 [ ...created , ...updated ] . forEach ( object => {
8188 hasButtons = true ;
8289 const { title } = object ;
@@ -92,7 +99,7 @@ class ConsoleHistoryItem extends PureComponent<
9299 onClick = { ( ) => this . handleObjectClick ( object ) }
93100 className = "btn-console-object"
94101 disabled = { btnDisabled }
95- icon = { < ObjectIcon type = { object . type } /> }
102+ icon = { iconForType ( object . type ) }
96103 >
97104 { title }
98105 </ Button >
0 commit comments