// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT-0 import './App.css'; import { AmplifyAuthenticator, AmplifySignIn } from '@aws-amplify/ui-react'; import { Auth } from 'aws-amplify'; import { AppLayout, BreadcrumbGroup, Button, ButtonDropdown, Header, Inline, NorthStarThemeProvider, NotificationButton, SideNavigation, } from 'aws-northstar'; import { SideNavigationItemType } from 'aws-northstar/components/SideNavigation'; import { useState } from 'react'; import { BrowserRouter, Route, Switch } from 'react-router-dom'; import Dashboard from './components/dashboard'; import { Document } from './components/document'; import DocumentSchemas from './components/document-schemas'; import PDFFormReview from './components/review'; const App: React.FC = () => { const [user, setUser] = useState(); const openInNewTab = (url: string) => { window.open(url, '_blank', 'noopener,noreferrer'); }; return ( { try { setUser(await Auth.currentAuthenticatedUser()); } catch (err) { setUser(undefined); } }} >
{user ? ( {/* // @ts-ignore */} { await Auth.signOut(); window.location.reload(); }, }, ]} /> } /> } breadcrumbs={ } navigation={ } > } key={'dashboard'} /> } key={'docs'} /> } key={'review'} /> } key={'view'} /> } key={'viewDocument'} /> ) : ( <> )} ); }; export default App;