naveen07garg commited on
Commit
3b58275
verified
1 Parent(s): 34e60f1

Upload 3 files

Browse files
Files changed (3) hide show
  1. src/App.jsx +19 -0
  2. src/api.js +9 -0
  3. src/index.css +110 -13
src/App.jsx ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ChatWindow from "./components/ChatWindow";
2
+ import "./index.css";
3
+
4
+ export default function App() {
5
+ return (
6
+ <div className="app-container">
7
+ <header className="header">
8
+ <img src="/logo.png" alt="Logo" className="logo" />
9
+ <h2>Flyline HR Assistant 鉁堬笍</h2>
10
+ </header>
11
+
12
+ <ChatWindow />
13
+
14
+ <footer className="footer">
15
+ 漏 2025 Flyline Airlines 路 HR AI Assistant 路 AIML Oct 2024 Batch
16
+ </footer>
17
+ </div>
18
+ );
19
+ }
src/api.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ export async function sendMessageToBot(message, history = []) {
2
+ const response = await fetch("https://your-hf-space-url/api/chat", {
3
+ method: "POST",
4
+ headers: { "Content-Type": "application/json" },
5
+ body: JSON.stringify({ message, history })
6
+ });
7
+
8
+ return response.json(); // {answer: "...", citations: [...] }
9
+ }
src/index.css CHANGED
@@ -1,13 +1,110 @@
1
- body {
2
- margin: 0;
3
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5
- sans-serif;
6
- -webkit-font-smoothing: antialiased;
7
- -moz-osx-font-smoothing: grayscale;
8
- }
9
-
10
- code {
11
- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12
- monospace;
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body {
2
+ margin: 0;
3
+ font-family: "Inter", sans-serif;
4
+ background: #f5f7fb;
5
+ }
6
+
7
+ .app-container {
8
+ display: flex;
9
+ flex-direction: column;
10
+ height: 100vh;
11
+ }
12
+
13
+ .header, .footer {
14
+ padding: 8px 12px;
15
+ text-align: center;
16
+ background: white;
17
+ border-bottom: 1px solid #ddd;
18
+ }
19
+
20
+ .footer {
21
+ border-top: 1px solid #ddd;
22
+ font-size: 12px;
23
+ color: #666;
24
+ }
25
+
26
+ .chat-window {
27
+ flex: 1;
28
+ display: flex;
29
+ flex-direction: column;
30
+ }
31
+
32
+ .chat-body {
33
+ flex: 1;
34
+ padding: 12px;
35
+ overflow-y: auto;
36
+ }
37
+
38
+ .bubble-row {
39
+ display: flex;
40
+ margin-bottom: 12px;
41
+ }
42
+
43
+ .bubble-row.user { justify-content: flex-end; }
44
+ .bubble-row.bot { justify-content: flex-start; }
45
+
46
+ .bubble {
47
+ padding: 10px 14px;
48
+ border-radius: 16px;
49
+ max-width: 70%;
50
+ font-size: 14px;
51
+ animation: fade 0.2s ease-in-out;
52
+ }
53
+
54
+ .bubble-row.user .bubble {
55
+ background: #4caf50;
56
+ color: white;
57
+ }
58
+
59
+ .bubble-row.bot .bubble {
60
+ background: #2196f3;
61
+ color: white;
62
+ }
63
+
64
+ .chat-input {
65
+ padding: 10px;
66
+ display: flex;
67
+ gap: 6px;
68
+ background: white;
69
+ border-top: 1px solid #ddd;
70
+ }
71
+
72
+ .chat-input input {
73
+ flex: 1;
74
+ padding: 10px;
75
+ font-size: 14px;
76
+ border-radius: 8px;
77
+ border: 1px solid #bbb;
78
+ }
79
+
80
+ .chat-input button {
81
+ padding: 8px 16px;
82
+ background: #2196f3;
83
+ color: white;
84
+ border: none;
85
+ border-radius: 8px;
86
+ cursor: pointer;
87
+ }
88
+
89
+ .suggested {
90
+ display: flex;
91
+ gap: 6px;
92
+ flex-wrap: wrap;
93
+ padding: 8px;
94
+ }
95
+
96
+ .suggested button {
97
+ padding: 4px 10px;
98
+ font-size: 12px;
99
+ border-radius: 6px;
100
+ border: 1px solid #bbb;
101
+ background: white;
102
+ cursor: pointer;
103
+ }
104
+
105
+ .citation-panel {
106
+ background: #fff7e6;
107
+ border-top: 1px solid #e6c77b;
108
+ padding: 8px;
109
+ font-size: 13px;
110
+ }