Files
stats/apps/start/src/routes/_app.tsx
Carl-Gerhard Lindesvärd d7c6e88adc fix: change order keys for clickhouse tables
* wip

* rename

* fix: minor things before merging new order keys

* fix: add maintenance mode

* fix: update order by for session and events

* fix: remove properties from sessions and final migration test

* fix: set end date on migrations

* fix: comments
2025-12-16 12:48:51 +01:00

52 lines
1.5 KiB
TypeScript

import { FullPageEmptyState } from '@/components/full-page-empty-state';
import { Sidebar } from '@/components/sidebar';
import { Button, LinkButton, buttonVariants } from '@/components/ui/button';
import { useAppContext } from '@/hooks/use-app-context';
import { cn } from '@/utils/cn';
import { Outlet, createFileRoute, redirect } from '@tanstack/react-router';
import { ConstructionIcon } from 'lucide-react';
export const Route = createFileRoute('/_app')({
beforeLoad: async ({ context }) => {
if (!context.session.session) {
throw redirect({ to: '/login' });
}
},
component: AppLayout,
});
function AppLayout() {
const { isMaintenance } = useAppContext();
if (isMaintenance) {
return (
<FullPageEmptyState
icon={ConstructionIcon}
className="min-h-screen"
title="Maintenance mode"
description="We are currently performing maintenance on the system. Please check back later."
>
<a
href="https://status.openpanel.dev/"
className={cn(buttonVariants())}
target="_blank"
rel="noopener noreferrer"
>
Check out our status page
</a>
</FullPageEmptyState>
);
}
return (
<div className="flex h-screen w-full">
<Sidebar />
<div className="lg:pl-72 w-full">
<div className="block lg:hidden bg-background h-16 w-full fixed top-0 z-10 border-b" />
<div className="block lg:hidden h-16" />
<Outlet />
</div>
</div>
);
}