@@ -3,7 +3,6 @@ import { Box, Flex, Tab, TabList, TabPanel, TabPanels, Tabs } from '@invoke-ai/u
33import { useAppSelector } from 'app/store/storeHooks' ;
44import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants' ;
55import { ControlLayersPanelContent } from 'features/controlLayers/components/ControlLayersPanelContent' ;
6- import { useControlLayersTitle } from 'features/controlLayers/hooks/useControlLayersTitle' ;
76import { Prompts } from 'features/parameters/components/Prompts/Prompts' ;
87import QueueControls from 'features/queue/components/QueueControls' ;
98import { SDXLPrompts } from 'features/sdxl/components/SDXLPrompts/SDXLPrompts' ;
@@ -16,7 +15,7 @@ import { RefinerSettingsAccordion } from 'features/settingsAccordions/components
1615import { activeTabNameSelector } from 'features/ui/store/uiSelectors' ;
1716import { OverlayScrollbarsComponent } from 'overlayscrollbars-react' ;
1817import type { CSSProperties } from 'react' ;
19- import { memo } from 'react' ;
18+ import { memo , useMemo } from 'react' ;
2019import { useTranslation } from 'react-i18next' ;
2120
2221const overlayScrollbarsStyles : CSSProperties = {
@@ -39,7 +38,13 @@ const selectedStyles: ChakraProps['sx'] = {
3938const ParametersPanelTextToImage = ( ) => {
4039 const { t } = useTranslation ( ) ;
4140 const activeTabName = useAppSelector ( activeTabNameSelector ) ;
42- const controlLayersTitle = useControlLayersTitle ( ) ;
41+ const controlLayersCount = useAppSelector ( ( s ) => s . controlLayers . present . layers . length ) ;
42+ const controlLayersTitle = useMemo ( ( ) => {
43+ if ( controlLayersCount === 0 ) {
44+ return t ( 'controlLayers.controlLayers' ) ;
45+ }
46+ return `${ t ( 'controlLayers.controlLayers' ) } (${ controlLayersCount } )` ;
47+ } , [ controlLayersCount , t ] ) ;
4348 const isSDXL = useAppSelector ( ( s ) => s . generation . model ?. base === 'sdxl' ) ;
4449
4550 return (
0 commit comments