u
This commit is contained in:
@@ -44,66 +44,14 @@ import {
|
||||
SHADOW_BUBBLE_USER,
|
||||
SURFACE_RAISED,
|
||||
} from '../../colors';
|
||||
import {
|
||||
TOOL_ICON_MAP,
|
||||
TOOL_GERMAN_NAMES,
|
||||
GoogleFaviconIcon,
|
||||
} from './chatTools.jsx';
|
||||
import { InlineMentionText } from './ChatMentionPill';
|
||||
|
||||
class GoogleFaviconIcon extends PureComponent {
|
||||
state = { hasError: false };
|
||||
|
||||
handleError = () => {
|
||||
this.setState({ hasError: true });
|
||||
};
|
||||
|
||||
render() {
|
||||
const { sx } = this.props;
|
||||
if (this.state.hasError) {
|
||||
return <GoogleIcon sx={sx} />;
|
||||
}
|
||||
return (
|
||||
<Box
|
||||
component="img"
|
||||
src="https://www.google.com/favicon.ico"
|
||||
alt="Google"
|
||||
onError={this.handleError}
|
||||
sx={{
|
||||
width: 18,
|
||||
height: 18,
|
||||
borderRadius: '2px',
|
||||
objectFit: 'contain',
|
||||
verticalAlign: 'middle',
|
||||
display: 'inline-block',
|
||||
...sx,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const TOOL_ICON_MAP = {
|
||||
find_files: SearchRoundedIcon,
|
||||
javascript_execute: ComputerRoundedIcon,
|
||||
search_images: ImageSearchRoundedIcon,
|
||||
analyze_image: CompareRoundedIcon,
|
||||
apisuggestionsorissues: SupportIcon,
|
||||
ask_user: RecordVoiceOverIcon,
|
||||
dashback_request: PhonelinkIcon,
|
||||
patch: SaveAsIcon,
|
||||
read_file: DescriptionIcon,
|
||||
reset_vfs: DeleteForeverIcon,
|
||||
rm: DeleteIcon,
|
||||
web_search: GoogleFaviconIcon,
|
||||
url_get: WebIcon,
|
||||
subagent: EngineeringIcon,
|
||||
sub_agent: EngineeringIcon,
|
||||
'sub-agent': EngineeringIcon,
|
||||
pdf_read: PictureAsPdfIcon,
|
||||
search_articles: ManageSearchIcon,
|
||||
edit_image: LensBlurIcon,
|
||||
net_gross_calc: CalculateIcon,
|
||||
ean_checksum: QrCodeScannerIcon,
|
||||
'set-user-route': DirectionsIcon,
|
||||
set_user_route: DirectionsIcon,
|
||||
draft_delivery_manifest: EditNoteIcon,
|
||||
'draft-delivery-manifest': EditNoteIcon,
|
||||
};
|
||||
export { TOOL_ICON_MAP, TOOL_GERMAN_NAMES, GoogleFaviconIcon };
|
||||
|
||||
function formatMessageTime(isoString) {
|
||||
if (!isoString) return '';
|
||||
@@ -1155,7 +1103,7 @@ function MessageRow({ msg, showTime = true }) {
|
||||
|
||||
{cleanText ? (
|
||||
isUser ? (
|
||||
cleanText
|
||||
<InlineMentionText text={cleanText} isUser={true} />
|
||||
) : (
|
||||
<HealingMarkdown text={cleanText} streaming={msg.streaming} />
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user