import { CheckIcon, ClipboardIcon } from "@heroicons/react/24/outline"
import Markdown from "../../Common/Markdown"
import React from "react"
type Props = {
message: string
hideCopy?: boolean
botAvatar?: JSX.Element
userAvatar?: JSX.Element
isBot: boolean
name: string
images?: string[]
}
export const PlaygroundMessage = (props: Props) => {
const [isBtnPressed, setIsBtnPressed] = React.useState(false)
React.useEffect(() => {
if (isBtnPressed) {
setTimeout(() => {
setIsBtnPressed(false)
}, 4000)
}
}, [isBtnPressed])
return (
{props.isBot ? (
!props.botAvatar ? (
) : (
props.botAvatar
)
) : !props.userAvatar ? (
) : (
props.userAvatar
)}
{props.isBot && (
{props.name}
)}
{/* source if aviable */}
{props.isBot && (
{!props.hideCopy && (
)}
)}
{props.images && (
{props.images.map((image, index) => (
))}
)}
)
}