Skip to content

Commit

Permalink
(#72) ๐Ÿ”„ refactor: ์นดํ…Œ๊ณ ๋ฆฌ์ฑ— ์ปดํฌ๋„ŒํŠธํ™”ํ•œ ๋งํ’์„ ์œผ๋กœ ์ถœ๋ ฅ
Browse files Browse the repository at this point in the history
  • Loading branch information
inaemon committed Nov 27, 2024
1 parent 1bc8e1d commit 82a5b1b
Showing 1 changed file with 8 additions and 22 deletions.
30 changes: 8 additions & 22 deletions src/pages/Chatbot/components/CategoryChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { questionCategories } from "@/src/constants/ChatbotData";
import Image from "next/image";
import tailIcon from "@/src/assets/webp/chatbot_message_left_tail_white_big.webp"; // ๊ผฌ๋ž‘์ง€

import RookieWhiteListMessageWithTail from "@/src/pages/Chatbot/components/message/custom/RookieWhiteListMessageWithTail";
import RookieImageMessage from "@/src/pages/Chatbot/components/message/custom/RookieImageMessage";

import { GuideGetResponseType } from "@/src/api/ChatbotApiType";
import { handleGetGuideAnswer } from "@/src/api/ChatbotApiHandler";

Expand Down Expand Up @@ -35,35 +38,18 @@ const CategoryChat = ({stadiumName, categoryKey, categoryFrontName, onResponseUp
{/* image ๊ฐ’์ด ์žˆ๋Š” ๊ฒฝ์šฐ: image ๋ Œ๋”๋ง */}
{"image" in categoryData && categoryData.image && (
<div className="mb-2">
{/* ์ด๋ฏธ์ง€ ๋‚ด์šฉ */}
<Image
src={categoryData.image}
alt="Category Icon"
className="max-w-full h-auto rounded-md"
/>
{/* ์ด๋ฏธ์ง€ ๋‚ด์šฉ ์ถœ๋ ฅ*/}
<RookieImageMessage imgUrl={categoryData.image} />
</div>
)}


{/* ํ”„๋ก ํŠธ์—์„œ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฐ์ดํ„ฐ: ํ…์ŠคํŠธ ์ถœ๋ ฅ */}
{/* answer ๊ฐ’์ด ์žˆ๋Š” ๊ฒฝ์šฐ: answer ๋ Œ๋”๋ง */}
{"answer" in categoryData && categoryData.answer && (
<div className="p-4 bg-main-0 rounded-lg shadow mb-2">

{/* ๋งํ’์„  ๊ผฌ๋ž‘์ง€ */}
<Image src={tailIcon} alt="๊ผฌ๋ž‘์ง€" className="absolute left-[-12px] w-5 h-5"/>

{/* ๋‹ต๋ณ€ ๋‚ด์šฉ */}
<ul className="space-y-1.5">
{categoryData.answer.map((answer, index) => (
<li
key={index}
className="px-2 text-xs min-w-[180px] w-full text-left font-regular text-grayscale-90 rounded-md"
>
{answer}
</li>
))}
</ul>
<div className="mb-2">
{/* ๋‹ต๋ณ€ ๋‚ด์šฉ ์ถœ๋ ฅ */}
<RookieWhiteListMessageWithTail messageList={categoryData.answer} />
</div>
)}

Expand Down

0 comments on commit 82a5b1b

Please sign in to comment.