mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
48 lines
933 B
TypeScript
48 lines
933 B
TypeScript
'use client'
|
|
|
|
import Link from 'next/link'
|
|
import React, { Suspense, useEffect } from 'react'
|
|
import { useRouter } from 'next/navigation'
|
|
|
|
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
const router = useRouter()
|
|
|
|
// We export these so that we can access them from tests
|
|
useEffect(() => {
|
|
// @ts-ignore
|
|
window.router = router
|
|
// @ts-ignore
|
|
window.React = React
|
|
}, [router])
|
|
|
|
return (
|
|
<Suspense
|
|
fallback={
|
|
<html>
|
|
<body />
|
|
</html>
|
|
}
|
|
>
|
|
<html>
|
|
<head></head>
|
|
<body
|
|
style={{
|
|
margin: 0,
|
|
}}
|
|
>
|
|
<div
|
|
style={{
|
|
position: 'fixed',
|
|
top: 0,
|
|
left: 0,
|
|
}}
|
|
>
|
|
<Link id="to-vertical-page" href="1" />
|
|
</div>
|
|
{children}
|
|
</body>
|
|
</html>
|
|
</Suspense>
|
|
)
|
|
}
|