UNPKG

@ibm-adw/skill-toolkit

Version:

Developing your own skills with IBM Automation Digital Worker Skill Toolkit

45 lines (34 loc) 1.27 kB
/* Licensed Materials - Property of IBM 5737-I23 Copyright IBM Corp. 2019. All Rights Reserved. U.S. Government Users Restricted Rights: Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ import React, { useContext } from 'react'; import './CatalogView.scss'; import { ComponentList } from './component-list/ComponentList'; import { Loading } from 'carbon-components-react'; import intl from 'react-intl-universal'; import { LocaleContext, useLocale } from '../../common/locale'; const CatalogView = () => { const localeContext = useContext(LocaleContext); const nlsLoaded = useLocale(() => [ import(/* webpackChunkName: "nls" */ `./nls/${localeContext.currentLocale}.json`), import(/* webpackChunkName: "nls" */ `./nls/${localeContext.fallbackLocale}.json`) ]); if (nlsLoaded) { return ( <div className="adw--test-content-catalog-container"> <h2>{intl.get('catalog.CATALOG_VIEW_TITLE')}</h2> <div className="adw--test-content-catalog"> <ComponentList/> </div> </div> ); } else { return <div><Loading withOverlay={false} /></div>; } }; export { CatalogView };