Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
16 lines
295 B
TypeScript
16 lines
295 B
TypeScript
import { auth } from '@clerk/nextjs/server'
|
|
import { redirect } from 'next/navigation'
|
|
|
|
export default async function AdminLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode
|
|
}) {
|
|
const { userId } = await auth()
|
|
|
|
if (!userId) {
|
|
redirect('/sign-in')
|
|
}
|
|
|
|
return <>{children}</>
|
|
}
|