Skip to content

Commit 3b85908

Browse files
authored
Merge pull request #3 from Tatsu723/tatsu
質問の入力フォームを実装
2 parents 07a44d9 + 5451d01 commit 3b85908

File tree

2 files changed

+109
-4
lines changed

2 files changed

+109
-4
lines changed

app/[docs_id]/chatForm.tsx

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

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)