File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
packages/coreui-react/src/components/table Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -11,17 +11,12 @@ export const pretifyName = (name: string) => {
1111}
1212
1313export const getColumnLabel = ( column : Column | string ) =>
14- typeof column === 'object'
15- ? column . label !== undefined
16- ? column . label
17- : pretifyName ( column . key )
18- : pretifyName ( column )
14+ typeof column === 'object' ? column . label ?? pretifyName ( column . key ) : pretifyName ( column )
1915
2016export const getColumnNames = ( columns : ( string | Column ) [ ] | undefined , items ?: Item [ ] ) =>
2117 columns
2218 ? columns . map ( ( column : Column | string ) => {
23- if ( typeof column === 'object' ) return column . key
24- else return column
19+ return typeof column === 'object' ? column . key : column
2520 } )
2621 : items && getColumnNamesFromItems ( items )
2722
You can’t perform that action at this time.
0 commit comments