Skip to content

Commit

Permalink
(#72) ๐ŸŽจ design: ๋ฃจํ‚ค new line ๋ฐ˜์˜ ๊ผฌ๋ž‘์ง€ ๋งํ’์„  ์ œ์ž‘
Browse files Browse the repository at this point in the history
  • Loading branch information
inaemon committed Nov 27, 2024
1 parent 7a50d83 commit b6e0524
Showing 1 changed file with 25 additions and 0 deletions.
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;

0 comments on commit b6e0524

Please sign in to comment.