164 | {/* Chat Section */}
165 |
166 |
167 | {messages.map((message, index) => (
168 |
176 |
181 |
182 | ))}
183 | {loading && (
184 |
187 | )}
188 |
189 |
190 |
207 |
208 |
209 |
210 | {/* PDF Section */}
211 |
212 | {file ? (
213 | <>
214 |
215 |
216 |
217 |
218 |
219 |
220 | Page {pageNumber} of {numPages}
221 |
222 |
223 |
224 |
225 |
236 |
247 |
248 | >
249 | ) : (
250 |
251 |
252 |
handleUpload(e.target.files ? e.target.files[0] : null)}
257 | accept="application/pdf"
258 | />
259 |
268 |
269 |
270 | )}
271 |
272 |
273 | );
274 | }
275 |
276 |
--------------------------------------------------------------------------------
/src/app/layout.tsx:
--------------------------------------------------------------------------------
1 | import type { Metadata } from "next";
2 | import { Geist, Geist_Mono } from "next/font/google";
3 | import "./globals.css";
4 |
5 | const geistSans = Geist({
6 | variable: "--font-geist-sans",
7 | subsets: ["latin"],
8 | });
9 |
10 | const geistMono = Geist_Mono({
11 | variable: "--font-geist-mono",
12 | subsets: ["latin"],
13 | });
14 |
15 | export const metadata: Metadata = {
16 | title: "Create Next App",
17 | description: "Generated by create next app",
18 | };
19 |
20 | export default function RootLayout({
21 | children,
22 | }: Readonly<{
23 | children: React.ReactNode;
24 | }>) {
25 | return (
26 |
27 |
30 |