Copy icon smaller
This commit is contained in:
parent
1d1bcb3e13
commit
02915b9a23
@ -14,6 +14,7 @@ import CheckIcon from '@mui/icons-material/Check';
|
|||||||
import { MessageData, MessageMeta } from './MessageMeta';
|
import { MessageData, MessageMeta } from './MessageMeta';
|
||||||
import { ChatBubble } from './ChatBubble';
|
import { ChatBubble } from './ChatBubble';
|
||||||
import { StyledMarkdown } from './StyledMarkdown';
|
import { StyledMarkdown } from './StyledMarkdown';
|
||||||
|
import { Tooltip } from '@mui/material';
|
||||||
|
|
||||||
type MessageList = MessageData[];
|
type MessageList = MessageData[];
|
||||||
|
|
||||||
@ -73,20 +74,24 @@ const Message = ({ message, submitQuery, isFullWidth }: MessageInterface) => {
|
|||||||
return (
|
return (
|
||||||
<ChatBubble className="Message" isFullWidth={isFullWidth} role={message.role} sx={{ flexGrow: 1, pb: message.metadata ? 0 : "8px", m: 0, mb: 1, mt: 1, overflowX: "auto" }}>
|
<ChatBubble className="Message" isFullWidth={isFullWidth} role={message.role} sx={{ flexGrow: 1, pb: message.metadata ? 0 : "8px", m: 0, mb: 1, mt: 1, overflowX: "auto" }}>
|
||||||
<CardContent ref={textFieldRef} sx={{ position: "relative", display: "flex", flexDirection: "column", overflowX: "auto" }}>
|
<CardContent ref={textFieldRef} sx={{ position: "relative", display: "flex", flexDirection: "column", overflowX: "auto" }}>
|
||||||
|
<Tooltip title="Copy to clipboard" placement="top" arrow>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={handleCopy}
|
onClick={handleCopy}
|
||||||
sx={{
|
sx={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: 8,
|
top: 8,
|
||||||
right: 8,
|
right: 8,
|
||||||
|
width: 24,
|
||||||
|
height: 24,
|
||||||
bgcolor: 'background.paper',
|
bgcolor: 'background.paper',
|
||||||
'&:hover': { bgcolor: 'action.hover' },
|
'&:hover': { bgcolor: 'action.hover' },
|
||||||
}}
|
}}
|
||||||
size="small"
|
size="small"
|
||||||
color={copied ? "success" : "default"}
|
color={copied ? "success" : "default"}
|
||||||
>
|
>
|
||||||
{copied ? <CheckIcon /> : <ContentCopyIcon />}
|
{copied ? <CheckIcon sx={{ width: 16, height: 16 }} /> : <ContentCopyIcon sx={{ width: 16, height: 16 }} />}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
|
|
||||||
{message.role !== 'user' ?
|
{message.role !== 'user' ?
|
||||||
<StyledMarkdown
|
<StyledMarkdown
|
||||||
|
Loading…
x
Reference in New Issue
Block a user