generated from chiffre-io/template-library
-
-
Notifications
You must be signed in to change notification settings - Fork 161
/
Copy pathlayout.tsx
77 lines (74 loc) · 2.32 KB
/
layout.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import { Banner } from 'fumadocs-ui/components/banner'
import { RootProvider } from 'fumadocs-ui/provider'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import Link from 'next/link'
import Script from 'next/script'
import { NuqsAdapter } from 'nuqs/adapters/next'
import type { ReactNode } from 'react'
import { ResponsiveHelper } from '../components/responsive-helpers'
import { cn } from '../lib/utils'
import './globals.css'
const inter = Inter({
subsets: ['latin'],
fallback: ['sans-serif']
})
export const metadata = {
title: {
template: '%s | nuqs',
default: 'nuqs'
},
description:
'Type-safe search params state management for React. Like useState, but stored in the URL query string.',
authors: [
{
name: 'François Best',
url: 'https://francoisbest.com'
}
]
} satisfies Metadata
export default function Layout({ children }: { children: ReactNode }) {
const enableChiffreAnalytics = process.env.VERCEL_ENV === 'production'
return (
<html
lang="en"
className={cn(inter.className, 'antialiased')}
// https://github.com/shadcn-ui/ui/issues/5552#issuecomment-2435024526
suppressHydrationWarning
>
<body>
<Banner
variant="rainbow"
className="text-md gap-4 font-semibold"
id="nuqs-2-announcement"
>
<span aria-hidden>🎉</span>
<Link
href="/blog/nuqs-2"
className="decoration-slice decoration-1 transition-all hover:underline hover:underline-offset-8 focus-visible:underline focus-visible:outline-none"
prefetch={false}
>
Announcing nuqs version 2
</Link>
<span aria-hidden>🎉</span>
</Banner>
<RootProvider>
<NuqsAdapter>{children}</NuqsAdapter>
</RootProvider>
{enableChiffreAnalytics && (
<Script
async
id="chiffre:analytics"
src="https://chiffre.io/analytics.js"
data-chiffre-project-id="odWoaH0aUUwm42Wf"
data-chiffre-public-key="pk.3EPMj_faODyzisb0UNmZnzhIkG9sbj7zR5em6lf7Olk"
referrerPolicy="origin"
crossOrigin="anonymous"
data-chiffre-ignore-paths="/stats"
/>
)}
<ResponsiveHelper />
</body>
</html>
)
}