import { ChatStoreMessage } from "./app";
interface Props {
chat: ChatStoreMessage;
renderMarkdown: boolean;
}
export function MessageDetail({ chat, renderMarkdown }: Props) {
if (typeof chat.content === "string") {
return
;
}
return (
{chat.content.map((mdt) =>
mdt.type === "text" ? (
chat.hide ? (
mdt.text?.split("\n")[0].slice(0, 16) + "... (deleted)"
) : renderMarkdown ? (
// @ts-ignore
) : (
mdt.text
)
) : (

{
window.open(mdt.image_url?.url, "_blank");
}}
/>
)
)}
);
}