-
Notifications
You must be signed in to change notification settings - Fork 80
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
Ryan Holinshead
committed
Jan 3, 2024
1 parent
2567e43
commit 2080486
Showing
4 changed files
with
52 additions
and
20 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
python/src/aiconfig/editor/client/src/components/MimeTypeRenderer.tsx
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,18 @@ | ||
import { memo } from "react"; | ||
import { Image } from "@mantine/core"; | ||
|
||
type Props = { | ||
mimeType?: string; | ||
content: string; | ||
}; | ||
|
||
export default memo(function MimeTypeRenderer({ mimeType, content }: Props) { | ||
const mimetype = (mimeType ?? "text/plain").split("/", 1)[0]; // MIME type without subtype | ||
switch (mimetype) { | ||
case "image": | ||
// TODO: Figure out base64 encoding | ||
return <Image alt="Attachment image" src={content} maw={300} />; | ||
default: // "text" | ||
return <span>{content}</span>; | ||
} | ||
}); |
18 changes: 0 additions & 18 deletions
18
.../src/aiconfig/editor/client/src/components/prompt/prompt_input/attachments/Attachment.tsx
This file was deleted.
Oops, something went wrong.
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
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