1
- import { Flex , Text } from '@invoke-ai/ui-library' ;
1
+ import { Flex , Icon , Text } from '@invoke-ai/ui-library' ;
2
2
import { useAppSelector } from 'app/store/storeHooks' ;
3
3
import { useCallbackOnDragEnter } from 'common/hooks/useCallbackOnDragEnter' ;
4
4
import type { IDockviewPanelHeaderProps } from 'dockview' ;
5
5
import { selectActiveTab } from 'features/ui/store/uiSelectors' ;
6
6
import type { TabName } from 'features/ui/store/uiTypes' ;
7
7
import { memo , useCallback , useRef } from 'react' ;
8
+ import type { IconType } from 'react-icons' ;
8
9
import {
9
10
PiBoundingBoxBold ,
10
11
PiCubeBold ,
@@ -14,13 +15,13 @@ import {
14
15
PiTextAaBold ,
15
16
} from 'react-icons/pi' ;
16
17
17
- const TAB_ICONS : Record < TabName , React . ReactElement > = {
18
- generate : < PiTextAaBold /> ,
19
- canvas : < PiBoundingBoxBold /> ,
20
- upscaling : < PiFrameCornersBold /> ,
21
- workflows : < PiFlowArrowBold /> ,
22
- models : < PiCubeBold /> ,
23
- queue : < PiQueueBold /> ,
18
+ const TAB_ICONS : Record < TabName , IconType > = {
19
+ generate : PiTextAaBold ,
20
+ canvas : PiBoundingBoxBold ,
21
+ upscaling : PiFrameCornersBold ,
22
+ workflows : PiFlowArrowBold ,
23
+ models : PiCubeBold ,
24
+ queue : PiQueueBold ,
24
25
} ;
25
26
26
27
export const TabWithLaunchpadIcon = memo ( ( props : IDockviewPanelHeaderProps ) => {
@@ -35,20 +36,10 @@ export const TabWithLaunchpadIcon = memo((props: IDockviewPanelHeaderProps) => {
35
36
36
37
useCallbackOnDragEnter ( setActive , ref , 300 ) ;
37
38
38
- // Show icon only for Launchpad panel
39
- const isLaunchpadPanel = props . api . id === 'launchpad' ;
40
- const currentTabIcon = TAB_ICONS [ activeTab ] ;
41
-
42
39
return (
43
- < Flex ref = { ref } alignItems = "center" h = "full" >
44
- { isLaunchpadPanel && currentTabIcon && (
45
- < Flex alignItems = "center" pl = { 5 } pr = { 2 } >
46
- { currentTabIcon }
47
- </ Flex >
48
- ) }
49
- < Text userSelect = "none" px = { isLaunchpadPanel ? 3 : 4 } >
50
- { props . api . title ?? props . api . id }
51
- </ Text >
40
+ < Flex ref = { ref } alignItems = "center" h = "full" px = { 4 } gap = { 3 } >
41
+ < Icon as = { TAB_ICONS [ activeTab ] } color = "invokeYellow.300" boxSize = { 5 } />
42
+ < Text userSelect = "none" > { props . api . title ?? props . api . id } </ Text >
52
43
</ Flex >
53
44
) ;
54
45
} ) ;
0 commit comments