-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
14 deletions.
There are no files selected for viewing
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,7 @@ | ||
import { FC } from "react" | ||
|
||
const Avatar: FC = () => { | ||
return <div className="bg-red-500 rounded h-8 w-8"></div> | ||
} | ||
|
||
export default Avatar |
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,23 @@ | ||
import { FC } from "react" | ||
import ReactMarkdown from "react-markdown" | ||
import remarkGfm from "remark-gfm" | ||
import { IMessage } from "../../pages/chat" | ||
import Avatar from "./avatar" | ||
|
||
interface Props { | ||
message: IMessage | ||
} | ||
|
||
const Message: FC<Props> = ({ message }) => { | ||
return ( | ||
<div className="flex gap-4"> | ||
<Avatar /> | ||
|
||
<div className="prose"> | ||
<ReactMarkdown children={message.content} remarkPlugins={[remarkGfm]} /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Message |
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