-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#72) ๐จ design: ๋ฃจํค new line ๋ฐ์ ๊ผฌ๋์ง ๋งํ์ ์ ์
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/pages/Chatbot/components/message/custom/RookiePreformattedMessageWithTail.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from "react"; | ||
import Image from "next/image"; | ||
import tailIcon from "@/src/assets/webp/chatbot_message_left_tail_white_big.webp"; // ๊ผฌ๋์ง | ||
|
||
interface Props { | ||
messageList: string[] | ||
} | ||
|
||
// ์ฑ๋ด ์ปค์คํ ๋งํ์ ์ปดํฌ๋ํธ | ||
// /n(new line) ๋ฑ์ด ๋ฐ์๋๋๋ก whitespace-pre-wrap ์คํ์ผ ์ ์ฉํ ๋งํ์ | ||
const RookiePreformattedMessage = ({messageList}: Props) => { | ||
return ( | ||
<div className="whitespace-pre-wrap bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 max-w-xs"> | ||
{/* ๋งํ์ ๊ผฌ๋์ง */} | ||
<Image src={tailIcon} alt="๊ผฌ๋์ง" className="absolute left-[-12px] top-2 w-5 h-5"/> | ||
|
||
{/** ๋ฉ์์ง 1์ค ์ด์ ๋ฐฐ์ด๋ก ๋ฐ์์ ์ฌ๋ฌ pํ๊ทธ๋ก ๋ฉ์์ง ์ถ๋ ฅํ๊ธฐ */} | ||
{messageList.map((message, index) => ( | ||
<p key={index}>{message}</p> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default RookiePreformattedMessage; |