import * as React from 'react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { AuthProvider, useAuth, AuthPage } from "../auth/src"; import AdminLayout from "./components/AdminLayout"; import ResourceView from "./components/ResourceView"; import { config } from "./config"; import { Box, Typography, Paper } from '@mui/material'; import AppTheme from "../src/shared-theme/AppTheme"; const queryClient = new QueryClient(); function Dashboard() { return ( Welcome to the Admin Panel Select a resource from the sidebar to manage data. {config.resources.map(res => ( {res.pluralLabel} ))} ); } function AdminApp() { const { currentUser, login, logout, loading, error } = useAuth(); const [selectedResourceName, setSelectedResourceName] = React.useState(null); if (!currentUser) { return ( { }} // Disable registration for Admin loading={loading} error={error} onSwitchMode={() => { }} onBack={function (): void { throw new Error("Function not implemented."); }} currentUser={undefined} /> ); } const selectedResource = config.resources.find(r => r.name === selectedResourceName); return ( {selectedResource ? ( ) : ( )} ); } export default function App() { return ( ); }