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

Adds back markdown wrapper to messages #154

Merged
merged 2 commits into from
Oct 18, 2024
Merged
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
23 changes: 10 additions & 13 deletions www/components/messagebox.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { useState } from "react";
import Image from "next/image";
import icon from "@/public/bloomicon.jpg";
import usericon from "@/public/usericon.svg";
import Skeleton from "react-loading-skeleton";
import { FaLightbulb, FaThumbsDown, FaThumbsUp } from "react-icons/fa";
import { API, type Message } from "@/utils/api";
import Spinner from "./spinner";
import { useState } from 'react';
import Image from 'next/image';
import icon from '@/public/bloomicon.jpg';
import usericon from '@/public/usericon.svg';
import Skeleton from 'react-loading-skeleton';
import { FaLightbulb } from 'react-icons/fa';
import { API } from '@/utils/api';
import MarkdownWrapper from './markdownWrapper';

export type Reaction = "thumbs_up" | "thumbs_down" | null;


interface MessageBoxProps {
isUser?: boolean;
userId?: string;
Expand Down Expand Up @@ -101,11 +102,7 @@ export default function MessageBox({
/>
)}
<div className="flex flex-col gap-2 w-full">
{loading ? (
<Skeleton count={4} />
) : (
<div className="message-content">{text}</div>
)}
{loading ? <Skeleton count={4} /> : <MarkdownWrapper text={text} />}
{!loading && !isUser && shouldShowButtons && (
<div className="flex justify-start gap-2 mt-2">
<button
Expand Down
Loading