Spaces:
Build error
Build error
Moved 'Header' & 'Main' component to layout
Browse files- frontend/app/about/page.tsx +17 -23
- frontend/app/chat/page.tsx +1 -6
- frontend/app/components/header.tsx +1 -1
- frontend/app/layout.tsx +8 -1
- frontend/app/page.tsx +34 -39
- frontend/app/query/page.tsx +1 -6
- frontend/app/search/page.tsx +1 -6
- frontend/app/sign-in/page.tsx +25 -30
- frontend/app/status/page.tsx +22 -27
frontend/app/about/page.tsx
CHANGED
@@ -1,32 +1,26 @@
|
|
1 |
"use client";
|
2 |
|
3 |
-
import Header from "@/app/components/header";
|
4 |
-
import Main from "@/app/components/ui/main-container";
|
5 |
-
|
6 |
export default function About() {
|
7 |
|
8 |
return (
|
9 |
-
<
|
10 |
-
<
|
11 |
-
|
12 |
-
|
13 |
-
<
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
integration, we aim to revolutionize the way JTC employees access and comprehend crucial documents.
|
26 |
-
</p>
|
27 |
-
</div>
|
28 |
</div>
|
29 |
</div>
|
30 |
-
</
|
31 |
);
|
32 |
}
|
|
|
1 |
"use client";
|
2 |
|
|
|
|
|
|
|
3 |
export default function About() {
|
4 |
|
5 |
return (
|
6 |
+
<div className="rounded-xl shadow-xl p-4 mb-8 max-w-5xl w-full">
|
7 |
+
<div className="max-w-2xl mx-auto p-4">
|
8 |
+
<div className="bg-gradient-to-r from-blue-500 to-indigo-500 text-white p-8 rounded-lg shadow-lg">
|
9 |
+
<h1 className="text-2xl md:text-4xl font-bold mb-4">About Smart Retrieval</h1>
|
10 |
+
<p className="text-l mb-4">
|
11 |
+
Welcome to Smart Retrieval, your go-to platform for efficient and streamlined information retrieval,
|
12 |
+
especially in the realm of legal and compliance documents.
|
13 |
+
</p>
|
14 |
+
<p className="text-l mb-4">
|
15 |
+
Our mission is to enhance user experiences at JTC by addressing key challenges such as manual search
|
16 |
+
inefficiencies and rigid file naming conventions.
|
17 |
+
</p>
|
18 |
+
<p className="text-l mb-4">
|
19 |
+
With cutting-edge technology, including Large Language Models (LLM) like GPT, BERT, and advanced chatbot
|
20 |
+
integration, we aim to revolutionize the way JTC employees access and comprehend crucial documents.
|
21 |
+
</p>
|
|
|
|
|
|
|
22 |
</div>
|
23 |
</div>
|
24 |
+
</div>
|
25 |
);
|
26 |
}
|
frontend/app/chat/page.tsx
CHANGED
@@ -1,15 +1,10 @@
|
|
1 |
"use client";
|
2 |
|
3 |
-
import Header from "@/app/components/header";
|
4 |
-
import Main from "@/app/components/ui/main-container";
|
5 |
import ChatSection from "@/app/components/chat-section";
|
6 |
|
7 |
export default function Chat() {
|
8 |
|
9 |
return (
|
10 |
-
<
|
11 |
-
<Header />
|
12 |
-
<ChatSection />
|
13 |
-
</Main>
|
14 |
);
|
15 |
}
|
|
|
1 |
"use client";
|
2 |
|
|
|
|
|
3 |
import ChatSection from "@/app/components/chat-section";
|
4 |
|
5 |
export default function Chat() {
|
6 |
|
7 |
return (
|
8 |
+
<ChatSection />
|
|
|
|
|
|
|
9 |
);
|
10 |
}
|
frontend/app/components/header.tsx
CHANGED
@@ -257,7 +257,7 @@ export default function Header() {
|
|
257 |
{/* Status Page Button/Indicator */}
|
258 |
<span className='flex items-center mr-1'>API:</span>
|
259 |
<NavLink href='/status'>
|
260 |
-
<div className="flex items-center mr-2 text-
|
261 |
{apiError ? (
|
262 |
<span role="img" aria-label="red circle">
|
263 |
🔴
|
|
|
257 |
{/* Status Page Button/Indicator */}
|
258 |
<span className='flex items-center mr-1'>API:</span>
|
259 |
<NavLink href='/status'>
|
260 |
+
<div className="flex items-center mr-2 text-xl transition duration-300 ease-in-out transform hover:scale-125">
|
261 |
{apiError ? (
|
262 |
<span role="img" aria-label="red circle">
|
263 |
🔴
|
frontend/app/layout.tsx
CHANGED
@@ -2,6 +2,8 @@ import type { Metadata } from "next";
|
|
2 |
import { Inter } from "next/font/google";
|
3 |
import "./globals.css";
|
4 |
import { Providers } from './providers'
|
|
|
|
|
5 |
|
6 |
const inter = Inter({ subsets: ["latin"] });
|
7 |
|
@@ -27,7 +29,12 @@ export default function RootLayout({
|
|
27 |
return (
|
28 |
<html lang="en">
|
29 |
<body className={inter.className}>
|
30 |
-
<Providers>
|
|
|
|
|
|
|
|
|
|
|
31 |
</body>
|
32 |
</html>
|
33 |
);
|
|
|
2 |
import { Inter } from "next/font/google";
|
3 |
import "./globals.css";
|
4 |
import { Providers } from './providers'
|
5 |
+
import Header from "@/app/components/header";
|
6 |
+
import Main from "@/app/components/ui/main-container";
|
7 |
|
8 |
const inter = Inter({ subsets: ["latin"] });
|
9 |
|
|
|
29 |
return (
|
30 |
<html lang="en">
|
31 |
<body className={inter.className}>
|
32 |
+
<Providers>
|
33 |
+
<Main>
|
34 |
+
<Header />
|
35 |
+
{children}
|
36 |
+
</Main>
|
37 |
+
</Providers>
|
38 |
</body>
|
39 |
</html>
|
40 |
);
|
frontend/app/page.tsx
CHANGED
@@ -1,54 +1,49 @@
|
|
1 |
"use client";
|
2 |
|
3 |
-
import Header from "@/app/components/header";
|
4 |
import Image from 'next/image';
|
5 |
import Link from 'next/link';
|
6 |
-
import { useState } from 'react'
|
7 |
-
import { IconSpinner } from '@/app/components/ui/icons'
|
8 |
-
import logo from '../public/smart-retrieval-logo.webp'
|
9 |
-
import Main from "@/app/components/ui/main-container";
|
10 |
|
11 |
export default function Home() {
|
12 |
const [isLoading, setIsLoading] = useState(false);
|
13 |
|
14 |
return (
|
15 |
-
<
|
16 |
-
<
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
<
|
30 |
-
|
31 |
-
|
32 |
-
Your intelligent solution for quick and accurate information retrieval.
|
33 |
-
</p>
|
34 |
-
</div>
|
35 |
</div>
|
36 |
</div>
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
</
|
49 |
-
</
|
50 |
</div>
|
51 |
</div>
|
52 |
-
</
|
53 |
);
|
54 |
}
|
|
|
1 |
"use client";
|
2 |
|
|
|
3 |
import Image from 'next/image';
|
4 |
import Link from 'next/link';
|
5 |
+
import { useState } from 'react';
|
6 |
+
import { IconSpinner } from '@/app/components/ui/icons';
|
7 |
+
import logo from '../public/smart-retrieval-logo.webp';
|
|
|
8 |
|
9 |
export default function Home() {
|
10 |
const [isLoading, setIsLoading] = useState(false);
|
11 |
|
12 |
return (
|
13 |
+
<div className="rounded-xl shadow-xl p-4 mb-8 max-w-5xl w-full">
|
14 |
+
<div className="max-w-2xl mx-auto p-4 text-center">
|
15 |
+
<div className="flex flex-col items-center mb-4 bg-gradient-to-r from-blue-500 to-indigo-500 text-white p-8 rounded-lg shadow-lg">
|
16 |
+
<div className="flex flex-col md:flex-row items-center md:items-start">
|
17 |
+
<Image
|
18 |
+
src={logo}
|
19 |
+
alt="Smart Retrieval Logo"
|
20 |
+
width={150}
|
21 |
+
height={150}
|
22 |
+
priority
|
23 |
+
className="rounded-lg mb-4 md:mb-0 md:mr-4"
|
24 |
+
/>
|
25 |
+
<div className='flex flex-col mt-4'>
|
26 |
+
<h1 className="text-4xl font-bold mb-2 md:text-5xl">Smart Retrieval</h1>
|
27 |
+
<p className="text-lg md:text-xl text-gray-200">
|
28 |
+
Your intelligent solution for quick and accurate information retrieval.
|
29 |
+
</p>
|
|
|
|
|
|
|
30 |
</div>
|
31 |
</div>
|
32 |
+
</div>
|
33 |
+
<div className="flex flex-col mt-8 text-center items-center max-w-full">
|
34 |
+
<p id='get-started-paragraph' className="text-xl text-gray-700 dark:text-gray-200 mb-4">
|
35 |
+
Experience the power of Smart Retrieval today!
|
36 |
+
</p>
|
37 |
+
<Link href="/chat" onClick={() => { setIsLoading(true); }}>
|
38 |
+
<div className="flex text-center items-center text-xl bg-blue-500 text-white px-6 py-3 rounded-md font-bold transition duration-300 ease-in-out transform hover:scale-125">
|
39 |
+
{isLoading ? (
|
40 |
+
<IconSpinner className="mr-2 animate-spin" />
|
41 |
+
) : null}
|
42 |
+
Get Started
|
43 |
+
</div>
|
44 |
+
</Link>
|
45 |
</div>
|
46 |
</div>
|
47 |
+
</div>
|
48 |
);
|
49 |
}
|
frontend/app/query/page.tsx
CHANGED
@@ -1,15 +1,10 @@
|
|
1 |
"use client";
|
2 |
|
3 |
-
import Header from "@/app/components/header";
|
4 |
-
import Main from "@/app/components/ui/main-container";
|
5 |
import QuerySection from "@/app/components/query-section";
|
6 |
|
7 |
export default function Query() {
|
8 |
|
9 |
return (
|
10 |
-
<
|
11 |
-
<Header />
|
12 |
-
<QuerySection />
|
13 |
-
</Main>
|
14 |
);
|
15 |
}
|
|
|
1 |
"use client";
|
2 |
|
|
|
|
|
3 |
import QuerySection from "@/app/components/query-section";
|
4 |
|
5 |
export default function Query() {
|
6 |
|
7 |
return (
|
8 |
+
<QuerySection />
|
|
|
|
|
|
|
9 |
);
|
10 |
}
|
frontend/app/search/page.tsx
CHANGED
@@ -1,15 +1,10 @@
|
|
1 |
"use client";
|
2 |
|
3 |
-
import Header from "@/app/components/header";
|
4 |
-
import Main from "@/app/components/ui/main-container";
|
5 |
import SearchSection from "@/app/components/search-section";
|
6 |
|
7 |
export default function Search() {
|
8 |
|
9 |
return (
|
10 |
-
<
|
11 |
-
<Header />
|
12 |
-
<SearchSection />
|
13 |
-
</Main>
|
14 |
);
|
15 |
}
|
|
|
1 |
"use client";
|
2 |
|
|
|
|
|
3 |
import SearchSection from "@/app/components/search-section";
|
4 |
|
5 |
export default function Search() {
|
6 |
|
7 |
return (
|
8 |
+
<SearchSection />
|
|
|
|
|
|
|
9 |
);
|
10 |
}
|
frontend/app/sign-in/page.tsx
CHANGED
@@ -1,45 +1,40 @@
|
|
1 |
"use client";
|
2 |
|
3 |
import { GoogleLoginButton, SGIDLoginButton } from '@/app/components/login-buttons';
|
4 |
-
import Header from "@/app/components/header";
|
5 |
-
import Main from "@/app/components/ui/main-container";
|
6 |
|
7 |
const SignInPage = () => {
|
8 |
return (
|
9 |
-
<
|
10 |
-
<
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
<
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
18 |
</p>
|
19 |
-
<div className="flex
|
20 |
-
<
|
21 |
-
<SGIDLoginButton />
|
22 |
-
<p className="text-gray-200 text-sm">
|
23 |
-
Note: SGID login is only available via SingPass.
|
24 |
-
</p>
|
25 |
-
<div className="flex items-center justify-center gap-4">
|
26 |
-
<div className="w-full h-px bg-gray-300"></div>
|
27 |
-
</div>
|
28 |
-
<button
|
29 |
-
className="text-white font-bold hover:underline mt-4 rounded-md shadow-lg py-2 bg-gray-500 hover:bg-gray-300"
|
30 |
-
onClick={() => {
|
31 |
-
// Redirect back to the home page
|
32 |
-
window.location.href = '/';
|
33 |
-
}}
|
34 |
-
>
|
35 |
-
Cancel
|
36 |
-
</button>
|
37 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
</div>
|
39 |
</div>
|
40 |
</div>
|
41 |
</div>
|
42 |
-
</
|
43 |
);
|
44 |
};
|
45 |
|
|
|
1 |
"use client";
|
2 |
|
3 |
import { GoogleLoginButton, SGIDLoginButton } from '@/app/components/login-buttons';
|
|
|
|
|
4 |
|
5 |
const SignInPage = () => {
|
6 |
return (
|
7 |
+
<div className="rounded-xl shadow-xl p-4 mb-8 max-w-5xl w-full">
|
8 |
+
<div className="max-w-2xl mx-auto text-center">
|
9 |
+
<div className="flex flex-col items-center justify-center py-10 space-y-4">
|
10 |
+
<div className="bg-blue-500 text-white px-8 py-6 rounded-lg shadow-lg">
|
11 |
+
<h1 className="text-4xl font-bold mb-4">Sign in to Smart Retrieval!</h1>
|
12 |
+
<p className="text-lg text-gray-200 mb-4">
|
13 |
+
Your intelligent solution for quick and accurate information retrieval.
|
14 |
+
</p>
|
15 |
+
<div className="flex flex-col gap-4">
|
16 |
+
<GoogleLoginButton />
|
17 |
+
<SGIDLoginButton />
|
18 |
+
<p className="text-gray-200 text-sm">
|
19 |
+
Note: SGID login is only available via SingPass.
|
20 |
</p>
|
21 |
+
<div className="flex items-center justify-center gap-4">
|
22 |
+
<div className="w-full h-px bg-gray-300"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
</div>
|
24 |
+
<button
|
25 |
+
className="text-white font-bold hover:underline mt-4 rounded-md shadow-lg py-2 bg-gray-500 hover:bg-gray-300"
|
26 |
+
onClick={() => {
|
27 |
+
// Redirect back to the home page
|
28 |
+
window.location.href = '/';
|
29 |
+
}}
|
30 |
+
>
|
31 |
+
Cancel
|
32 |
+
</button>
|
33 |
</div>
|
34 |
</div>
|
35 |
</div>
|
36 |
</div>
|
37 |
+
</div>
|
38 |
);
|
39 |
};
|
40 |
|
frontend/app/status/page.tsx
CHANGED
@@ -3,8 +3,6 @@
|
|
3 |
import useSWR from 'swr';
|
4 |
import { Button } from "@nextui-org/react";
|
5 |
import { IconSpinner } from '@/app/components/ui/icons';
|
6 |
-
import Header from "@/app/components/header";
|
7 |
-
import Main from "@/app/components/ui/main-container";
|
8 |
|
9 |
// Define the API endpoint
|
10 |
const healthcheck_api = process.env.NEXT_PUBLIC_HEALTHCHECK_API;
|
@@ -46,33 +44,30 @@ const StatusPage = () => {
|
|
46 |
};
|
47 |
|
48 |
return (
|
49 |
-
<
|
50 |
-
<
|
51 |
-
|
52 |
-
<
|
53 |
-
<
|
54 |
-
<
|
55 |
-
<span className="font-bold">Status: </span>
|
56 |
-
<span>{isValidating ? (
|
57 |
-
<IconSpinner className="inline ml-2 animate-spin" />
|
58 |
-
) : apiStatus}</span>
|
59 |
-
</p>
|
60 |
-
<p><span className="font-bold">Response Data: </span>{isValidating ? (
|
61 |
<IconSpinner className="inline ml-2 animate-spin" />
|
62 |
-
) :
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
|
|
|
|
74 |
</div>
|
75 |
-
</
|
76 |
);
|
77 |
};
|
78 |
|
|
|
3 |
import useSWR from 'swr';
|
4 |
import { Button } from "@nextui-org/react";
|
5 |
import { IconSpinner } from '@/app/components/ui/icons';
|
|
|
|
|
6 |
|
7 |
// Define the API endpoint
|
8 |
const healthcheck_api = process.env.NEXT_PUBLIC_HEALTHCHECK_API;
|
|
|
44 |
};
|
45 |
|
46 |
return (
|
47 |
+
<div className="rounded-xl shadow-xl p-4 mb-8 max-w-5xl w-full bg-white dark:bg-zinc-700/30">
|
48 |
+
<div className="max-w-2xl space-y-2 p-4">
|
49 |
+
<h1 className="text-xl font-bold">Backend API Status</h1>
|
50 |
+
<p>
|
51 |
+
<span className="font-bold">Status: </span>
|
52 |
+
<span>{isValidating ? (
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
<IconSpinner className="inline ml-2 animate-spin" />
|
54 |
+
) : apiStatus}</span>
|
55 |
+
</p>
|
56 |
+
<p><span className="font-bold">Response Data: </span>{isValidating ? (
|
57 |
+
<IconSpinner className="inline ml-2 animate-spin" />
|
58 |
+
) : apiResponse}</p>
|
59 |
+
<Button
|
60 |
+
onClick={checkApiStatus}
|
61 |
+
disabled={isValidating} // Disable the button when isValidating is true
|
62 |
+
className="flex text-center items-center text-l disabled:bg-orange-400 bg-blue-500 text-white px-6 py-3 rounded-md font-bold transition duration-300 ease-in-out transform hover:scale-105"
|
63 |
+
>
|
64 |
+
{isValidating ? (
|
65 |
+
<IconSpinner className="mr-2 animate-spin" />
|
66 |
+
) : null}
|
67 |
+
Refresh Status
|
68 |
+
</Button>
|
69 |
</div>
|
70 |
+
</div>
|
71 |
);
|
72 |
};
|
73 |
|