@@ -23,7 +23,13 @@ interface IUseContentResponse {
23
23
dividerValue : ( ) => null | TableDividerType | unknown ;
24
24
getExpandedAria : ( ) => string | undefined ;
25
25
getValue : ( headerValue : ITableHeader ) => string | JSX . Element | DividerContent ;
26
- getBackgroundColorCellValue : ( headerValue : ITableHeader ) => string | undefined ;
26
+ getCellTokenValue : ( {
27
+ headerValue,
28
+ token,
29
+ } : {
30
+ headerValue : ITableHeader ;
31
+ token : string ;
32
+ } ) => string | undefined ;
27
33
handleShowExpandedContent : ( value : boolean ) => void ;
28
34
hasExpandedContentRow : boolean ;
29
35
hasFooter : boolean ;
@@ -91,14 +97,20 @@ export const useContent = (props: IUseContent): IUseContentResponse => {
91
97
return ( cellValue as ValueConfigType ) . value as string | JSX . Element ;
92
98
} ;
93
99
94
- const getBackgroundColorCellValue = ( headerValue : ITableHeader ) : string | undefined => {
100
+ const getCellTokenValue = ( {
101
+ headerValue,
102
+ token,
103
+ } : {
104
+ headerValue : ITableHeader ;
105
+ token : string ;
106
+ } ) : string | undefined => {
95
107
const cellValue = props . value [ headerValue . id ]
96
108
? ( props . value [ headerValue . id ] as string | JSX . Element | ValueConfigType )
97
109
: '-' ;
98
110
if ( React . isValidElement ( cellValue ) || typeof cellValue === 'string' ) {
99
111
return ;
100
112
}
101
- return ( cellValue as ValueConfigType ) . backgroundColor ;
113
+ return ( cellValue as ValueConfigType ) [ token ] ;
102
114
} ;
103
115
104
116
const hasExpandedContentRow = ! ! Object . getOwnPropertyDescriptor ( props . value , 'expandedContent' ) ;
@@ -111,7 +123,7 @@ export const useContent = (props: IUseContent): IUseContentResponse => {
111
123
dividerValue,
112
124
getExpandedAria,
113
125
getValue,
114
- getBackgroundColorCellValue ,
126
+ getCellTokenValue ,
115
127
handleShowExpandedContent,
116
128
hasExpandedContentRow,
117
129
hasFooter,
0 commit comments