2026-10-23 19:56:38 -07:00
|
|
|
import { MainLayout } from '@/components/layout/MainLayout';
|
|
|
|
|
import { Features } from '@/components/sections/Features';
|
|
|
|
|
import { Hero } from '@/components/sections/Hero';
|
|
|
|
|
import { LandingAbout } from '@/components/sections/LandingAbout';
|
|
|
|
|
import { SdkSection } from '@/components/sections/SdkSection';
|
2026-10-25 06:12:47 -07:00
|
|
|
import { isAdminSetupComplete } from '@/core/auth/adminUsers';
|
|
|
|
|
import { redirect } from 'next/navigation';
|
|
|
|
|
|
|
|
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
|
|
|
|
|
|
export default async function LandingPage() {
|
2026-11-19 20:22:01 +06:00
|
|
|
try {
|
|
|
|
|
const isConfigured = await isAdminSetupComplete();
|
|
|
|
|
if (!isConfigured) redirect('/vcon/setup');
|
|
|
|
|
} catch (error) {
|
|
|
|
|
if (
|
|
|
|
|
error &&
|
|
|
|
|
typeof error === 'object' &&
|
|
|
|
|
'digest' in error &&
|
|
|
|
|
String((error as { digest?: unknown }).digest).startsWith('NEXT_REDIRECT')
|
|
|
|
|
) {
|
|
|
|
|
throw error;
|
|
|
|
|
}
|
|
|
|
|
// Keep public landing accessible on transient DB outage instead of redirecting to setup
|
|
|
|
|
}
|
2026-10-23 19:56:38 -07:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<MainLayout>
|
|
|
|
|
<Hero />
|
|
|
|
|
<Features />
|
|
|
|
|
<SdkSection />
|
|
|
|
|
<LandingAbout />
|
|
|
|
|
</MainLayout>
|
|
|
|
|
);
|
2026-10-25 06:12:47 -07:00
|
|
|
}
|