22
33import { useState , FormEvent } from "react" ;
44import { askAI } from "@/app/actions/chatActions" ;
5+ import { StyledMarkdown } from "./markdown" ;
56
67export function ChatForm ( { documentContent } : { documentContent : string } ) {
78 const [ inputValue , setInputValue ] = useState ( "" ) ;
@@ -30,7 +31,7 @@ export function ChatForm({ documentContent }: { documentContent: string }) {
3031 return (
3132 < >
3233 { isFormVisible && (
33- < form className = "border border-2 border-primary shadow-xl p-6 rounded-lg bg-base-100" style = { { width :"100%" , textAlign :"center" , boxShadow :"-moz-initial" } } onSubmit = { handleSubmit } >
34+ < form className = "border border-2 border-secondary shadow-xl p-6 rounded-lg bg-base-100" style = { { width :"100%" , textAlign :"center" , boxShadow :"-moz-initial" } } onSubmit = { handleSubmit } >
3435 < h2 className = "text-xl font-bold mb-4 text-left relative -top-2 font-mono h-2" >
3536 AIへ質問
3637 </ h2 >
@@ -58,7 +59,7 @@ export function ChatForm({ documentContent }: { documentContent: string }) {
5859 < div className = "right-controls" >
5960 < button
6061 type = "submit"
61- className = "btn btn-soft btn-circle btn-primary rounded-full"
62+ className = "btn btn-soft btn-circle btn-accent border-2 border-accent rounded-full"
6263 title = "送信"
6364 style = { { marginTop :"10px" } }
6465 disabled = { isLoading }
@@ -82,8 +83,8 @@ export function ChatForm({ documentContent }: { documentContent: string }) {
8283 < article >
8384 < h3 className = "text-lg font-semibold mb-2" > AIの回答</ h3 >
8485 < div className = "chat chat-start" >
85- < div className = "chat-bubble chat-bubble-primary" >
86- < div className = "response-container" > { response } </ div >
86+ < div className = "chat-bubble bg-secondary-content text-black" style = { { maxWidth : "100%" , wordBreak : "break-word" } } >
87+ < div className = "response-container" > < StyledMarkdown content = { response } /> </ div >
8788 </ div >
8889 </ div >
8990 </ article >
0 commit comments