diff --git a/app/(auth)/api/auth/[...nextauth]/route.ts b/app/(auth)/api/auth/[...nextauth]/route.ts index d104b65..ba24234 100644 --- a/app/(auth)/api/auth/[...nextauth]/route.ts +++ b/app/(auth)/api/auth/[...nextauth]/route.ts @@ -1 +1 @@ -export { GET, POST } from "@/app/(auth)/auth"; +export { GET, POST } from '@/app/(auth)/auth'; diff --git a/app/(chat)/chat/[id]/page.tsx b/app/(chat)/chat/[id]/page.tsx index c125c88..7963b8f 100644 --- a/app/(chat)/chat/[id]/page.tsx +++ b/app/(chat)/chat/[id]/page.tsx @@ -7,7 +7,8 @@ import { getChatById } from "@/db/queries"; import { Chat } from "@/db/schema"; import { convertToUIMessages, generateUUID } from "@/lib/utils"; -export default async function Page({ params }: { params: any }) { +export default async function Page(props: { params: Promise }) { + const params = await props.params; const { id } = params; const chatFromDb = await getChatById({ id }); diff --git a/app/layout.tsx b/app/layout.tsx index 961c3f0..d7d9e23 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,24 +1,62 @@ -import { Metadata } from "next"; -import { Toaster } from "sonner"; +import { Metadata } from 'next'; +import { Toaster } from 'sonner'; -import { Navbar } from "@/components/custom/navbar"; -import { ThemeProvider } from "@/components/custom/theme-provider"; +import { Navbar } from '@/components/custom/navbar'; +import { ThemeProvider } from '@/components/custom/theme-provider'; -import "./globals.css"; +import './globals.css'; export const metadata: Metadata = { - metadataBase: new URL("https://chat.vercel.ai"), - title: "Next.js Chatbot Template", - description: "Next.js chatbot template using the AI SDK.", + metadataBase: new URL('https://chat.vercel.ai'), + title: 'Next.js Chatbot Template', + description: 'Next.js chatbot template using the AI SDK.', }; +export const viewport = { + maximumScale: 1, // Disable auto-zoom on mobile Safari +}; + +const LIGHT_THEME_COLOR = 'hsl(0 0% 100%)'; +const DARK_THEME_COLOR = 'hsl(240deg 10% 3.92%)'; +const THEME_COLOR_SCRIPT = `\ +(function() { + var html = document.documentElement; + var meta = document.querySelector('meta[name="theme-color"]'); + if (!meta) { + meta = document.createElement('meta'); + meta.setAttribute('name', 'theme-color'); + document.head.appendChild(meta); + } + function updateThemeColor() { + var isDark = html.classList.contains('dark'); + meta.setAttribute('content', isDark ? '${DARK_THEME_COLOR}' : '${LIGHT_THEME_COLOR}'); + } + var observer = new MutationObserver(updateThemeColor); + observer.observe(html, { attributes: true, attributeFilter: ['class'] }); + updateThemeColor(); +})();`; + export default async function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { return ( - + + +