Skip to content

Commit b0bfb00

Browse files
dashboard
1 parent 65d0fd6 commit b0bfb00

File tree

3 files changed

+120
-24
lines changed

3 files changed

+120
-24
lines changed

client/src/components/Aibot.jsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import React from 'react';
22
import Navbar from './Navbar';
33
const Tutor = () => {
44
const avatarNarration = 'Hello! How can I assist you today?';
5-
const ourReply = 'We would like to learn about artificial intelligence.';
5+
const ourReply = 'I would like to learn abt full adder.';
66
const tutorImages = [
77
'image1.jpg',
88
'image2.jpg',
99
'image3.jpg'
1010
];
1111

1212
return (
13-
<div>
13+
<div className="w-screen">
1414
<Navbar />
15-
<div className="flex flex-col items-center justify-center py-10">
16-
<div className="w-full max-w-xl bg-gray-100 rounded-lg shadow-lg p-6 mb-6">
15+
<div className="flex flex-col items-center justify-center h-screen w-screen text-center bg-gradient-to-tr from-violet-700 via-green-600 to-green-400 mt-3">
16+
<div className="w-full max-w-xl bg-gray-100 rounded-lg shadow-lg p-4 mb-6">
1717
<div className="flex items-center">
1818
<div className="w-16 h-16 rounded-full bg-blue-500 flex-shrink-0"></div>
1919
<div className="ml-4">
@@ -23,24 +23,26 @@ const Tutor = () => {
2323
</div>
2424
</div>
2525

26-
<div className="w-full max-w-xl bg-gray-100 rounded-lg shadow-lg p-6 mb-6">
26+
<div className="w-full max-w-xl bg-gray-100 rounded-lg shadow-lg p-6">
27+
<h3 className="text-lg font-medium mb-4">Related Media:</h3>
28+
<div className="grid grid-cols-3 gap-4">
29+
{tutorImages.map((image, index) => (
30+
<img key={index} src={image} alt={`Image ${index + 1}`} className="rounded-lg" />
31+
))}
32+
</div>
33+
</div>
34+
35+
<div className="w-full max-w-xl bg-gray-100 rounded-lg shadow-lg p-6 mb-6 mt-4">
2736
<div className="flex items-center">
2837
<div className="w-16 h-16 rounded-full bg-green-500 flex-shrink-0"></div>
2938
<div className="ml-4">
30-
<p className="text-lg font-bold">You</p>
39+
<p className="text-lg font-bold">Me</p>
3140
<p className="text-gray-500 text-sm">{ourReply}</p>
3241
</div>
3342
</div>
3443
</div>
3544

36-
<div className="w-full max-w-xl bg-gray-100 rounded-lg shadow-lg p-6">
37-
<h3 className="text-lg font-medium mb-4">Related Images:</h3>
38-
<div className="grid grid-cols-3 gap-4">
39-
{tutorImages.map((image, index) => (
40-
<img key={index} src={image} alt={`Image ${index + 1}`} className="rounded-lg" />
41-
))}
42-
</div>
43-
</div>
45+
4446
</div>
4547
</div>
4648
);
Lines changed: 100 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,103 @@
1-
import React from 'react'
1+
import React, { useState, useEffect } from "react";
2+
import { motion } from "framer-motion";
3+
4+
import Navbar from "./Navbar";
5+
6+
const data = {
7+
coursesCompleted: 5,
8+
coursesInProgress: 3,
9+
coursesEnrolled: 8,
10+
performance: [
11+
{ subject: "LD", score: 80 },
12+
{ subject: "DSA", score: 75 },
13+
{ subject: "OOPS", score: 90 },
14+
{ subject: "CAO", score: 85 },
15+
{ subject: "ALU", score: 70 },
16+
],
17+
attentionRate: 85,
18+
};
19+
20+
const COLORS = ["#0088FE", "#FFBB28"];
21+
22+
const Dashboard = () => {
23+
const [impTopicContent, setImpTopicContent] = useState("");
24+
const [topicListContent, setTopicListContent] = useState("");
25+
const [clusterQuestionsContent, setClusterQuestionsContent] = useState("");
26+
const [module1Content, setModule1Content] = useState("");
27+
const [showModule1Content, setShowModule1Content] = useState(false);
28+
29+
useEffect(() => {
30+
fetch("Files/generated_files/imp_topic_list.txt")
31+
.then((response) => response.text())
32+
.then((text) => setImpTopicContent(text))
33+
.catch((error) => console.log(error));
34+
35+
fetch("Files/generated_files/topic_list.txt")
36+
.then((response) => response.text())
37+
.then((text) => setTopicListContent(text))
38+
.catch((error) => console.log(error));
39+
40+
fetch("Files/generated_files/cluster_questions.txt")
41+
.then((response) => response.text())
42+
.then((text) => setClusterQuestionsContent(text))
43+
.catch((error) => console.log(error));
44+
}, []);
45+
46+
const fetchModule1Content = () => {
47+
fetch("Files/generated_files/summarised_notes/module1_summarized.txt")
48+
.then((response) => response.text())
49+
.then((text) => {
50+
setModule1Content(text);
51+
setShowModule1Content(true);
52+
})
53+
.catch((error) => console.log(error));
54+
};
55+
56+
const containerVariants = {
57+
hidden: { opacity: 0 },
58+
visible: { opacity: 1, transition: { duration: 0.5 } },
59+
};
260

3-
function Dashboard() {
461
return (
5-
<div>Dashboard</div>
6-
)
7-
}
62+
<div className="w-screen">
63+
<Navbar />
64+
<div className="flex flex-col items-center justify-center h-screen w-screen text-center bg-gradient-to-tr from-violet-700 via-green-600 to-green-400 mt-3">
65+
<div className="flex flex-wrap justify-center gap-8 p-6">
66+
<motion.div
67+
className="w-full sm:w-1/2 bg-slate-50 rounded-lg shadow-lg p-6"
68+
variants={containerVariants}
69+
initial="hidden"
70+
animate="visible"
71+
>
72+
<h3 className="text-lg font-medium mb-4">Important Topics</h3>
73+
<pre>{impTopicContent}</pre>
74+
</motion.div>
75+
76+
<motion.div
77+
className="w-full sm:w-1/2 bg-slate-50 rounded-lg shadow-lg p-6"
78+
variants={containerVariants}
79+
initial="hidden"
80+
animate="visible"
81+
transition={{ delay: 0.2 }}
82+
>
83+
<h3 className="text-lg font-medium mb-4">Topic List</h3>
84+
<pre>{topicListContent}</pre>
85+
</motion.div>
86+
87+
<motion.div
88+
className="w-full sm:w-1/2 bg-slate-50 rounded-lg shadow-lg p-6"
89+
variants={containerVariants}
90+
initial="hidden"
91+
animate="visible"
92+
transition={{ delay: 0.4 }}
93+
>
94+
<h3 className="text-lg font-medium mb-4">Cluster Questions</h3>
95+
<pre>{clusterQuestionsContent}</pre>
96+
</motion.div>
97+
</div>
98+
</div>
99+
</div>
100+
);
101+
};
8102

9-
export default Dashboard
103+
export { Dashboard as default };

client/src/components/Navbar.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ const Navbar = () => {
3030
>
3131
Home
3232
</Link>
33-
<Link
33+
{/* <Link
3434
to="/about"
3535
className="hover:text-gray-900 px-3 py-2 rounded-md text-sm"
3636
>
3737
About
38-
</Link>
38+
</Link> */}
3939
<Link
4040
to="/aibot"
4141
className="hover:text-gray-900 px-3 py-2 rounded-md text-sm"
4242
>
4343
Tutor
4444
</Link>
45-
<Link
45+
{/* <Link
4646
to="/team"
4747
className="hover:text-gray-900 px-3 py-2 rounded-md text-sm"
4848
>
4949
Quiz
50-
</Link>
50+
</Link> */}
5151
<Link
5252
to="/studyplanner"
5353
className="hover:text-gray-900 px-3 py-2 rounded-md text-sm"

0 commit comments

Comments
 (0)