import { AppShell, AuthProvider, DefaultSidebar, SidebarGroup, SidebarItem, SidebarLayout, useAuth, } from "@tailor-platform/app-shell"; import { useQuery } from "urql"; import { UserProfileMenu } from "@/components/composed/user-profile-menu"; import { graphql } from "@/graphql"; import { authClient } from "./lib/auth-client"; import { GraphQLProvider } from "./providers/graphql-provider"; const MeStatusQuery = graphql(` query MeStatus { me { status } } `); const AuthGuard = () => { const { login } = useAuth(); return (

Sign in required

Continue with your Tailor account to access this app.

); }; const ActiveUserGuard = ({ children }: { children: React.ReactNode }) => { const { logout } = useAuth(); const [{ data, fetching }] = useQuery({ query: MeStatusQuery }); if (fetching) return null; if (data?.me?.status !== "ACTIVE") { return (

Account deactivated

Your account has been deactivated. Please contact an administrator.

); } return <>{children}; }; const App = () => { return ( }> } /> ); }; export default App;