import { ApplePwaSplash } from '@/app/apple-pwa-splash' import { LocaleSwitcher } from '@/components/locale-switcher' import { ProgressBar } from '@/components/progress-bar' import { ServiceWorkerRegistration } from '@/components/service-worker-registration' import { ThemeProvider } from '@/components/theme-provider' import { ThemeToggle } from '@/components/theme-toggle' import { Button } from '@/components/ui/button' import { Toaster } from '@/components/ui/toaster' import { Analytics } from '@/lib/analytics/analytics' import { getAnalyticsConfig } from '@/lib/analytics/config' import { effectiveBaseUrl } from '@/lib/env' import { TRPCProvider } from '@/trpc/client' import type { Metadata, Viewport } from 'next' import { NextIntlClientProvider, useTranslations } from 'next-intl' import { getLocale, getMessages, getTranslations } from 'next-intl/server' import Image from 'next/image' import Link from 'next/link' import { Suspense } from 'react' import './globals.css' export async function generateMetadata(): Promise { const t = await getTranslations('Homepage') return { metadataBase: new URL(effectiveBaseUrl), title: { default: t('metaTitle'), template: '%s ยท Spliit', }, description: 'Spliit is a minimalist web application to share expenses with friends and family. No ads, no account, no problem.', openGraph: { title: t('metaTitle'), description: 'Spliit is a minimalist web application to share expenses with friends and family. No ads, no account, no problem.', images: `/banner.png`, type: 'website', url: '/', }, twitter: { card: 'summary_large_image', creator: '@scastiel', site: '@scastiel', images: `/banner.png`, title: t('metaTitle'), description: 'Spliit is a minimalist web application to share expenses with friends and family. No ads, no account, no problem.', }, appleWebApp: { capable: true, title: 'Spliit', }, applicationName: 'Spliit', icons: [ { url: '/android-chrome-192x192.png', sizes: '192x192', type: 'image/png', }, { url: '/android-chrome-512x512.png', sizes: '512x512', type: 'image/png', }, ], } } export const viewport: Viewport = { themeColor: '#047857', } function Content({ children }: { children: React.ReactNode }) { const t = useTranslations() return (

Spliit

{children}
Spliit
{t('Footer.madeIn')} {t.rich('Footer.builtBy', { author: (txt) => ( {txt} ), source: (txt) => ( {txt} ), })}
) } export default async function RootLayout({ children, }: { children: React.ReactNode }) { const locale = await getLocale() const messages = await getMessages() const analyticsConfig = await getAnalyticsConfig() return ( {/* Rendered inside the provider because it reads translations via `useTranslations`, which needs NextIntlClientProvider in its ancestor tree. */} {children} ) }