Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tsk 999 hot fix #62

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading