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) => {
11
11
}
12
12
13
13
export 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 )
19
15
20
16
export const getColumnNames = ( columns : ( string | Column ) [ ] | undefined , items ?: Item [ ] ) =>
21
17
columns
22
18
? 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
25
20
} )
26
21
: items && getColumnNamesFromItems ( items )
27
22
You can’t perform that action at this time.
0 commit comments