Skip to content

Commit

Permalink
(#72) ๐Ÿž fix: ๋ฐ˜๋ณต ๋ Œ๋”๋ง์‹œ ๊ณ ์œ  key๊ฐ’์„ ์ƒ์œ„ div ํƒœ๊ทธ์— ํ• ๋‹น
Browse files Browse the repository at this point in the history
  • Loading branch information
inaemon committed Nov 27, 2024
1 parent 2274792 commit c6c1c57
Showing 1 changed file with 32 additions and 34 deletions.
66 changes: 32 additions & 34 deletions src/pages/Chatbot/Chatbot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,40 +207,38 @@ const Chatbot = () => {

{/* ์นดํ…Œ๊ณ ๋ฆฌ ์„ ํƒ์‹œ ๋ฐฐ์—ด์— ์ €์žฅ ๋ฐ ์ˆœ์ฐจ ์ถœ๋ ฅ */}
{selectedStadium && selectedCategories.map((categoryFrontName, index) => (
<>
<div key={index}>
<>
{/* ์‚ฌ์šฉ์ž ๋‹ต๋ณ€ ์ถœ๋ ฅ */}
<UserChat messageList={[categoryFrontName]}/>

{/* ์„ ํƒ๋œ ์นดํ…Œ๊ณ ๋ฆฌ์— ๋Œ€ํ•œ ์ฑ—๋ด‡ ์‘๋‹ต ์ถœ๋ ฅ */}
<RookieChat
contentList={[
{
type: "component",
content: <CategoryChat stadiumName={selectedStadium} categoryKey={index} categoryFrontName={categoryFrontName} onResponseUpdate={handleGuideResponseUpdate} />
}
]}
/>


{/* ์„œ๋ธŒ ์นดํ…Œ๊ณ ๋ฆฌ ์„ ํƒ์‹œ ์ˆœ์ฐจ ์ถœ๋ ฅ */}
{/* Guide API ๋‹ต๋ณ€ ์ถœ๋ ฅ: ํ•ด๋‹น ์นดํ…Œ๊ณ ๋ฆฌ์—๋งŒ ๋งคํ•‘๋˜๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ํ•„ํ„ฐ๋งํ•˜์—ฌ ์ถœ๋ ฅ */}
{responseGuideDataList
.filter((responseGuideData) => responseGuideData.categoryNumber === index) // ํ˜„์žฌ ์นดํ…Œ๊ณ ๋ฆฌ์— ํ•ด๋‹นํ•˜๋Š” ๋ฐ์ดํ„ฐ๋งŒ ํ•„ํ„ฐ๋ง
.map((responseGuideData, responseIndex) => (
<>
<UserChat messageList={[responseGuideData.categoryName + " โ–ถ๏ธŽ " + responseGuideData.subCategoryName]}/>

{/* Guide API ๋‹ต๋ณ€ ์ถœ๋ ฅ: ํ•ด๋‹น ์นดํ…Œ๊ณ ๋ฆฌ์—๋งŒ ๋งคํ•‘๋˜๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ํ•„ํ„ฐ๋งํ•˜์—ฌ ์ถœ๋ ฅ */}
<div key={responseIndex} className="py-2">
{renderGuideAnswerData(responseGuideData)}
</div>
</>
))}
</>
</div>
</>
<div key={index}>
<>
{/* ์‚ฌ์šฉ์ž ๋‹ต๋ณ€ ์ถœ๋ ฅ */}
<UserChat messageList={[categoryFrontName]}/>

{/* ์„ ํƒ๋œ ์นดํ…Œ๊ณ ๋ฆฌ์— ๋Œ€ํ•œ ์ฑ—๋ด‡ ์‘๋‹ต ์ถœ๋ ฅ */}
<RookieChat
contentList={[
{
type: "component",
content: <CategoryChat stadiumName={selectedStadium} categoryKey={index} categoryFrontName={categoryFrontName} onResponseUpdate={handleGuideResponseUpdate} />
}
]}
/>


{/* ์„œ๋ธŒ ์นดํ…Œ๊ณ ๋ฆฌ ์„ ํƒ์‹œ ์ˆœ์ฐจ ์ถœ๋ ฅ */}
{/* Guide API ๋‹ต๋ณ€ ์ถœ๋ ฅ: ํ•ด๋‹น ์นดํ…Œ๊ณ ๋ฆฌ์—๋งŒ ๋งคํ•‘๋˜๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ํ•„ํ„ฐ๋งํ•˜์—ฌ ์ถœ๋ ฅ */}
{responseGuideDataList
.filter((responseGuideData) => responseGuideData.categoryNumber === index) // ํ˜„์žฌ ์นดํ…Œ๊ณ ๋ฆฌ์— ํ•ด๋‹นํ•˜๋Š” ๋ฐ์ดํ„ฐ๋งŒ ํ•„ํ„ฐ๋ง
.map((responseGuideData, responseIndex) => (
<div key={responseIndex}>
<UserChat messageList={[responseGuideData.categoryName + " โ–ถ๏ธŽ " + responseGuideData.subCategoryName]}/>

{/* Guide API ๋‹ต๋ณ€ ์ถœ๋ ฅ: ํ•ด๋‹น ์นดํ…Œ๊ณ ๋ฆฌ์—๋งŒ ๋งคํ•‘๋˜๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ํ•„ํ„ฐ๋งํ•˜์—ฌ ์ถœ๋ ฅ */}
<div className="py-2">
{renderGuideAnswerData(responseGuideData)}
</div>
</div>
))}
</>
</div>
))}

</div>
Expand Down

0 comments on commit c6c1c57

Please sign in to comment.