generated from chiffre-io/template-library
-
-
Notifications
You must be signed in to change notification settings - Fork 161
/
Copy pathlayout.tsx
62 lines (59 loc) · 1.8 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
import { RootProvider } from 'fumadocs-ui/provider'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
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 { NuqsV2AnnouncementTopBanner } from './banners'
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>
<NuqsV2AnnouncementTopBanner />
<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>
)
}