From 097a5c55c6b5940cede5f1fe12be7fd62d3092b4 Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Fri, 24 Oct 2025 22:57:56 +0530
Subject: [PATCH] feat(layout): add everything inside chat provider
---
src/app/c/[chatId]/page.tsx | 7 +------
src/app/layout.tsx | 5 +++--
src/app/page.tsx | 10 +---------
src/components/ChatWindow.tsx | 5 ++---
src/lib/hooks/useChat.tsx | 22 +++++++++++++++++-----
5 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/src/app/c/[chatId]/page.tsx b/src/app/c/[chatId]/page.tsx
index 672107a..c913b40 100644
--- a/src/app/c/[chatId]/page.tsx
+++ b/src/app/c/[chatId]/page.tsx
@@ -1,16 +1,11 @@
'use client';
import ChatWindow from '@/components/ChatWindow';
-import { useParams } from 'next/navigation';
import React from 'react';
-import { ChatProvider } from '@/lib/hooks/useChat';
const Page = () => {
- const { chatId }: { chatId: string } = useParams();
return (
-
diff --git a/src/lib/hooks/useChat.tsx b/src/lib/hooks/useChat.tsx
index ab346ec..84225a5 100644
--- a/src/lib/hooks/useChat.tsx
+++ b/src/lib/hooks/useChat.tsx
@@ -17,7 +17,7 @@ import {
useState,
} from 'react';
import crypto from 'crypto';
-import { useSearchParams } from 'next/navigation';
+import { useParams, useSearchParams } from 'next/navigation';
import { toast } from 'sonner';
import { getSuggestions } from '../actions';
import { MinimalProvider } from '../models/types';
@@ -274,15 +274,14 @@ export const chatContext = createContext