@@ -21,31 +21,34 @@ import {
2121 TabPanel ,
2222 Tabs ,
2323} from "react-aria-components" ;
24+ import { Spinner } from "../spinner/spinner.component" ;
2425
2526type CardTabsProps = {
2627 resizeId : string ;
2728 languageCode : string ;
2829 title : string | null ;
2930 cards : CardComponentProps [ ] ;
3031 activeTabId : string ;
32+ isLoading ?: boolean ;
3133 handleActiveCardChange : ( tabId : string ) => void ;
3234} ;
3335
3436const CardTabs : React . FC < CardTabsProps > = ( {
3537 resizeId,
3638 title,
3739 cards,
40+ isLoading,
3841 activeTabId,
3942 handleActiveCardChange,
4043} ) => {
4144 const tabsId = useId ( ) ;
4245
4346 const outputModalState$ = useDebuggerStore (
44- ( state ) => state . outputModalState$ ,
47+ ( state ) => state . outputModalState$
4548 ) ;
4649 const outputModalId$ = useDebuggerStore ( ( state ) => state . outputModalId$ ) ;
4750 const closeOutputModal$ = useDebuggerStore (
48- ( state ) => state . closeOutputModal$ ,
51+ ( state ) => state . closeOutputModal$
4952 ) ;
5053
5154 const activeCard = cards . filter ( ( card ) => card . id === activeTabId ) [ 0 ] ;
@@ -166,9 +169,12 @@ const CardTabs: React.FC<CardTabsProps> = ({
166169 className = { styles . cardTabs__container }
167170 >
168171 { title && (
169- < h4 id = { tabsId } className = { styles . cardTabs__title } >
170- { title }
171- </ h4 >
172+ < div className = { styles . cardTabs__title__container } >
173+ < h4 id = { tabsId } className = { styles . cardTabs__title } >
174+ { title }
175+ </ h4 >
176+ { isLoading && < Spinner /> }
177+ </ div >
172178 ) }
173179 < Tabs
174180 selectedKey = { activeCard . id }
@@ -269,6 +275,7 @@ type CardTabsWithTabPersistenceComponentProps = {
269275 languageCode : string ;
270276 title : string | null ;
271277 cards : CardComponentProps [ ] ;
278+ isLoading ?: boolean ;
272279 handleTabChange : ( key : string ) => void ;
273280} ;
274281
@@ -281,6 +288,7 @@ export const CardTabsWithTabPersistenceComponentProps: React.FC<
281288 languageCode,
282289 title,
283290 cards,
291+ isLoading,
284292 handleTabChange,
285293} ) => {
286294 const [ activeTabId , setActiveTabId ] = useState < string > ( initialTabId ) ;
@@ -309,6 +317,7 @@ export const CardTabsWithTabPersistenceComponentProps: React.FC<
309317 languageCode = { languageCode }
310318 title = { title }
311319 cards = { cards }
320+ isLoading = { isLoading }
312321 activeTabId = { activeTabId }
313322 handleActiveCardChange = { handleActiveCardChange }
314323 />
0 commit comments