File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
src/Shared/Components/TabGroup Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,18 @@ export const getTabIcon = ({
8
8
showError,
9
9
showWarning,
10
10
className,
11
- } : Pick < TabProps , 'showError' | 'showWarning' | 'icon' > & { className : string } ) => (
12
- < >
13
- { showError && < ICErrorExclamation className = { `${ className } ` } /> }
14
- { ! showError && showWarning && < ICWarning className = { `${ className } warning-icon-y7` } /> }
15
- { ! showError && ! showWarning && Icon && < Icon className = { `${ className } tab-group__tab__icon` } /> }
16
- </ >
17
- )
11
+ } : Pick < TabProps , 'showError' | 'showWarning' | 'icon' > & { className : string } ) => {
12
+ if ( showError ) {
13
+ return < ICErrorExclamation className = { className } />
14
+ }
15
+ if ( showWarning ) {
16
+ return < ICWarning className = { `${ className } warning-icon-y7` } />
17
+ }
18
+ if ( Icon ) {
19
+ return < Icon className = { `${ className } tab-group__tab__icon` } />
20
+ }
21
+ return null
22
+ }
18
23
19
24
export const getTabBadge = ( badge : TabProps [ 'badge' ] , className : string ) =>
20
25
badge !== null && < div className = { `tab-group__tab__badge bcn-1 cn-7 fw-6 flex px-4 ${ className } ` } > { badge } </ div >
You can’t perform that action at this time.
0 commit comments