Skip to content

Commit

Permalink
Merge pull request #62 from MARU-EGG/TSK-999-HotFix
Browse files Browse the repository at this point in the history
Tsk 999 hot fix
  • Loading branch information
sangmaaaaan authored Nov 13, 2024
2 parents 8e3c02b + 61d3739 commit d452469
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/hooks/use-preset-button.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ const usePresetButton = () => {
const { addMessage, setLoading, updateLastMessage, updateLastReference, updateReferenceDisabled } = useChatStore();

const handleReferenceButtonClick = (references: referenceState[]) => {
let content = '💡답변 출처를 알려드릴게요! 링크를 클릭하면 모집요강으로 확인할 수 있어요!\n';
let content = '💡답변 출처를 알려드릴게요! 출처를 클릭하면 모집요강으로 확인할 수 있어요!\n';
// references가 null, undefined, 또는 길이가 0인 경우 체크
if (!references || references.length === 0) {
addMessage({ content: '출처 정보가 없습니다.', role: 'system' });
return;
}
references.map((reference, index) => {
content += `\n출처${index + 1}: ${reference.link}\n`;
content += `\n[출처 ${index + 1}](${reference.link})\n`;
});
content += '\n📌 **답변을 꼭 확인해주세요!** ';
addMessage({ content: content, role: 'system' });
Expand Down
17 changes: 16 additions & 1 deletion src/ui/components/atom/chat-card/chat-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,22 @@ const ChatCard = ({ content, role, children }: ChatCardProps) => {
})}
>
<div className="text-md max-w-full font-pretendard font-normal">
{content === 'loading' ? <Loader /> : <ReactMarkdown remarkPlugins={[remarkGfm]}>{content}</ReactMarkdown>}
{content === 'loading' ? (
<Loader />
) : (
<ReactMarkdown
remarkPlugins={[remarkGfm]}
components={{
a: ({ node, ...props }) => (
<a {...props} className="font-pretendard text-blue-600" target="_blank" rel="noopener noreferrer">
{props.children}
</a>
),
}}
>
{content}
</ReactMarkdown>
)}
{children}
</div>
</div>
Expand Down

0 comments on commit d452469

Please sign in to comment.