react-code-dataset / wp-calypso /client /landing /subscriptions /components /tab-views /tab-view.tsx
react-code-dataset / wp-calypso /client /landing /subscriptions /components /tab-views /tab-view.tsx
Download wp-calypso/client/landing/subscriptions/components/tab-views/tab-view.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 591 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/subscriptions/components/tab-views/tab-view.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/landing/subscriptions/components/tab-views/tab-view.tsx
-
curl -L -o tab-view.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/subscriptions/components/tab-views/tab-view.tsx
591 Bytes
| import { Spinner } from '@wordpress/components'; | |
| import { Notice, NoticeType } from '../notice'; | |
| import './styles.scss'; | |
| type TabViewProps = { | |
| children: React.ReactNode; | |
| errorMessage?: string; | |
| isLoading?: boolean; | |
| }; | |
| const TabView = ( { children, errorMessage, isLoading = false }: TabViewProps ) => { | |
| if ( errorMessage ) { | |
| return <Notice type={ NoticeType.Error }>{ errorMessage }</Notice>; | |
| } | |
| if ( isLoading ) { | |
| return ( | |
| <div className="loading-container"> | |
| <Spinner /> | |
| </div> | |
| ); | |
| } | |
| return <div className="tab-view">{ children }</div>; | |
| }; | |
| export default TabView; | |