Skip to content

Commit 93ae1a7

Browse files
authored
Merge pull request #40 from AjouChatBot/feat/chatapi
feat: 키워드 ui
2 parents a4a76d1 + e3d152a commit 93ae1a7

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/components/chat/ChatInput.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { ChatMessage } from '../../types/chat';
1212
import { searchChatbotStreamAndUpdate } from '../../services/chatService';
1313
import { v4 as uuidv4 } from 'uuid';
1414
import { useNavigate } from 'react-router-dom';
15+
import Tag from '../../components/common/Tag';
1516

1617
interface ChatInputProps {
1718
mode: 'home' | 'chat' | 'search';
@@ -26,6 +27,7 @@ const ChatInput: React.FC<ChatInputProps> = ({ mode, onSend }) => {
2627
startKeywordCollection,
2728
chatLogs,
2829
handleSend: sendMessage,
30+
keywords,
2931
} = useChat();
3032
const [message, setMessage] = useState('');
3133
const [isOptionsOpen, setIsOptionsOpen] = useState(false);
@@ -286,6 +288,13 @@ const ChatInput: React.FC<ChatInputProps> = ({ mode, onSend }) => {
286288
<div className='mt-2 flex items-center gap-3'>
287289
<span className='text-xs text-gray-500'>인식한 키워드</span>
288290
{message.trim().length > 0 && <TypingDots />}
291+
{keywords.length > 0 && (
292+
<div className='flex gap-2'>
293+
{keywords.map((keyword: string, index: number) => (
294+
<Tag key={index} tagtext={keyword} />
295+
))}
296+
</div>
297+
)}
289298
</div>
290299
</div>
291300
)}

0 commit comments

Comments
 (0)