Files
cms-server/client/src/routes/_sidebarLayout/index.tsx
2025-12-25 02:17:41 +08:00

23 lines
504 B
TypeScript

import { createFileRoute, redirect } from '@tanstack/react-router';
import { SectionCards } from '@/components/section-cards';
import { hasToken } from '@/lib/token';
export const Route = createFileRoute('/_sidebarLayout/')({
component: Index,
beforeLoad: async () => {
if (!hasToken()) {
throw redirect({
to: '/login',
});
}
},
});
function Index() {
return (
<div className="flex flex-col gap-4 py-4 md:gap-6 md:py-6">
<SectionCards />
</div>
);
}