supermemory/apps/web/app/new/layout.tsx
Mahesh Sanikommu 645f89310c
PR: nova alpha release (#670)
Co-authored-by: Dhravya Shah <dhravya@supermemory.com>
2026-01-13 00:54:56 -08:00

22 lines
482 B
TypeScript

"use client"
import { useEffect } from "react"
import { useFeatureFlagEnabled } from "posthog-js/react"
import { useRouter } from "next/navigation"
export default function NewLayout({ children }: { children: React.ReactNode }) {
const router = useRouter()
const flagEnabled = useFeatureFlagEnabled("nova-alpha-access")
useEffect(() => {
if (!flagEnabled) {
router.push("/")
}
}, [flagEnabled, router])
if (!flagEnabled) {
return null
}
return <>{children}</>
}