Skip to content

Commit 035b3b4

Browse files
committed
質問の入力フォームを実装
1 parent a982136 commit 035b3b4

File tree

2 files changed

+118
-4
lines changed

2 files changed

+118
-4
lines changed

app/[docs_id]/chatForm.tsx

Lines changed: 117 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,120 @@
22

33
import { hello } from "./chatServer";
44

5-
export function ChatForm() {
6-
return <button className="btn" onClick={hello}>あああ</button>
7-
}
5+
export function ChatForm() {return (
6+
<>
7+
<style jsx>{`
8+
/* 簡単なCSSで見た目を整える(オプション) */
9+
body {
10+
font-family: sans-serif;
11+
display: flex;
12+
justify-content: center;
13+
align-items: center;
14+
min-height: 100vh;
15+
background-color: #f0f0f0;
16+
margin: 0;
17+
}
18+
.form-container {
19+
background-color: white;
20+
border-radius: 10px;
21+
box-shadow: 0 4px 8px rgba(67, 204, 216, 0.86);
22+
padding: 20px;
23+
width: 90%;
24+
max-width: 1000px;
25+
display: flex;
26+
flex-direction: column;
27+
}
28+
.input-area {
29+
border: 1px solid #ccc;
30+
border-radius: 8px;
31+
padding: 5px 15 px;
32+
margin-bottom: 15px;
33+
min-height: 150px; /* 入力欄の高さ */
34+
display: flex;
35+
}
36+
.text-input {
37+
border: none;
38+
outline: none;
39+
flex-grow: 1;
40+
font-size: 16px;
41+
resize: none; /* テキストエリアのリサイズを無効化 */
42+
overflow: auto;
43+
padding: 10px;
44+
}
45+
.controls {
46+
display: flex;
47+
align-items: center;
48+
justify-content: space-between;
49+
}
50+
.left-icons button {
51+
background: none;
52+
border: none;
53+
font-size: 24px;
54+
cursor: pointer;
55+
color: #555;
56+
margin-right: 15px;
57+
padding: 5px;
58+
}
59+
.left-icons button:hover {
60+
color: #000;
61+
}
62+
.left-icons span {
63+
font-size: 14px;
64+
vertical-align: middle;
65+
margin-left: 5px;
66+
color: #555;
67+
}
68+
.right-controls {
69+
display: flex;
70+
align-items: center;
71+
}
72+
.voice-icon button {
73+
background: none;
74+
border: none;
75+
font-size: 24px;
76+
cursor: pointer;
77+
color: #555;
78+
margin-right: 15px;
79+
padding: 5px;
80+
}
81+
.voice-icon button:hover {
82+
color: #000;
83+
}
84+
.send-button {
85+
background-color: #007bff; /* 青色の送信ボタン */
86+
color: white;
87+
border: none;
88+
border-radius: 50%; /* 丸いボタン */
89+
width: 40px;
90+
height: 40px;
91+
display: flex;
92+
justify-content: center;
93+
align-items: center;
94+
font-size: 20px;
95+
cursor: pointer;
96+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
97+
transition: background-color 0.3s ease;
98+
}
99+
.send-button:hover {
100+
background-color: #0056b3;
101+
}
102+
`}</style>
103+
104+
<div className="form-container">
105+
<div className="input-area">
106+
<textarea className="text-input" placeholder="質問を入力してください"></textarea>
107+
</div>
108+
109+
<div className="controls">
110+
<div className="left-icons">
111+
112+
</div>
113+
<div className="right-controls">
114+
<button type="submit" className="send-button" title="送信">
115+
<span className="icon"></span>
116+
</button>
117+
</div>
118+
</div>
119+
</div>
120+
</>
121+
)}

app/[docs_id]/chatServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"use server";
22

33
export async function hello() {
4-
console.log("hello, world");
4+
55
}

0 commit comments

Comments
 (0)