mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-28 05:25:33 +00:00
22 lines
482 B
TypeScript
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}</>
|
|
}
|