@@ -28,6 +28,7 @@ export default function PageLayoutNew({
2828 const [ showChatBot , setShowChatBot ] = useState < boolean > ( false ) ;
2929 const [ showDrawerChatbot , setShowDrawerChatbot ] = useState < boolean > ( true ) ;
3030 const [ clearHistoryData , setClearHistoryData ] = useState < boolean > ( false ) ;
31+ const [ showEnhancementDialog , setshowEnhancementDialog ] = useState < boolean > ( false ) ;
3132 const { userCredentials } = useCredentials ( ) ;
3233 const toggleLeftDrawer = ( ) => setIsLeftExpanded ( ! isLeftExpanded ) ;
3334 const toggleRightDrawer = ( ) => setIsRightExpanded ( ! isRightExpanded ) ;
@@ -86,16 +87,26 @@ export default function PageLayoutNew({
8687 < SideNav isExpanded = { isLeftExpanded } position = 'left' toggleDrawer = { toggleLeftDrawer } />
8788 < DrawerDropzone isExpanded = { isLeftExpanded } />
8889 < SchemaFromTextDialog
89- open = { showTextFromSchemaDialog }
90+ open = { showTextFromSchemaDialog . show }
9091 openSettingsDialog = { openSettingsDialog }
9192 onClose = { ( ) => {
92- setShowTextFromSchemaDialog ( false ) ;
93+ setShowTextFromSchemaDialog ( { triggeredFrom : '' , show : false } ) ;
94+ switch ( showTextFromSchemaDialog . triggeredFrom ) {
95+ case 'enhancementtab' :
96+ setshowEnhancementDialog ( true ) ;
97+ break ;
98+ case 'schemadialog' :
99+ openSettingsDialog ( ) ;
100+ break ;
101+ default :
102+ break ;
103+ }
93104 } }
94105 showAlert = { showAlert }
95106 > </ SchemaFromTextDialog >
96107 < SettingsModal
97108 openTextSchema = { ( ) => {
98- setShowTextFromSchemaDialog ( true ) ;
109+ setShowTextFromSchemaDialog ( { triggeredFrom : 'schemadialog' , show : true } ) ;
99110 } }
100111 open = { isSettingPanelExpanded }
101112 onClose = { closeSettingModal }
@@ -109,10 +120,12 @@ export default function PageLayoutNew({
109120 isRightExpanded = { isRightExpanded }
110121 showChatBot = { showChatBot }
111122 openTextSchema = { ( ) => {
112- setShowTextFromSchemaDialog ( true ) ;
123+ setShowTextFromSchemaDialog ( { triggeredFrom : 'schemadialog' , show : true } ) ;
113124 } }
114125 isSchema = { isSchema }
115126 setIsSchema = { setIsSchema }
127+ showEnhancementDialog = { showEnhancementDialog }
128+ setshowEnhancementDialog = { setshowEnhancementDialog }
116129 />
117130 { showDrawerChatbot && (
118131 < DrawerChatbot messages = { messages } isExpanded = { isRightExpanded } clearHistoryData = { clearHistoryData } />
0 commit comments