feat: Enhance image processing in data-fetching and update SEO meta tags for product images; add Telegram assistant link in ChatAssistant component with localization support

This commit is contained in:
sebseb7
2026-03-26 11:56:07 +01:00
parent c5dce64ac9
commit 1897ceb7c5
47 changed files with 372 additions and 244 deletions

View File

@@ -15,7 +15,13 @@ import StopIcon from '@mui/icons-material/Stop';
import PhotoCameraIcon from '@mui/icons-material/PhotoCamera';
import parse, { domToReact } from 'html-react-parser';
import { Link } from 'react-router-dom';
import MuiLink from '@mui/material/Link';
import { alpha } from '@mui/material/styles';
import TelegramIcon from '@mui/icons-material/Telegram';
import { isUserLoggedIn } from './LoginComponent.js';
import { withTranslation } from '../i18n/withTranslation.js';
const TELEGRAM_ASSISTANT_URL = 'https://t.me/Growheads_de_Bot';
// Initialize window object for storing messages
if (!window.chatMessages) {
window.chatMessages = [];
@@ -451,8 +457,9 @@ class ChatAssistant extends Component {
});
render() {
const { open, onClose } = this.props;
const { open, onClose, t } = this.props;
const { messages, inputValue, isTyping, isRecording, recordingTime, isGuest, privacyConfirmed } = this.state;
const showTelegramHint = !messages.some((m) => m.sender === 'user');
if (!open) {
return null;
@@ -517,6 +524,58 @@ class ChatAssistant extends Component {
gap: 2,
}}
>
{showTelegramHint && (
<Paper
elevation={4}
sx={{
p: 2,
borderRadius: 2,
border: 2,
borderColor: 'primary.main',
bgcolor: (theme) => alpha(theme.palette.primary.main, 0.14),
boxShadow: (theme) =>
`0 4px 14px ${alpha(theme.palette.primary.main, 0.35)}`,
}}
>
<Box sx={{ display: 'flex', gap: 1.5, alignItems: 'flex-start' }}>
<TelegramIcon
sx={{
fontSize: 40,
color: 'primary.main',
flexShrink: 0,
filter: (theme) =>
`drop-shadow(0 1px 2px ${alpha(theme.palette.primary.dark, 0.45)})`,
}}
/>
<Box sx={{ minWidth: 0 }}>
<Typography
variant="subtitle1"
component="div"
fontWeight={700}
color="text.primary"
sx={{ lineHeight: 1.45, mb: 0.25 }}
>
{t('chat.telegramAssistantIntro')}
</Typography>
<MuiLink
href={TELEGRAM_ASSISTANT_URL}
target="_blank"
rel="noopener noreferrer"
variant="subtitle1"
fontWeight={800}
sx={{
wordBreak: 'break-all',
color: 'primary.dark',
textDecorationColor: 'primary.main',
'&:hover': { color: 'primary.main' },
}}
>
{t('chat.telegramAssistantLink')}
</MuiLink>
</Box>
</Box>
</Paper>
)}
{messages &&messages.map((message) => (
<Box
key={message.id}
@@ -653,4 +712,4 @@ class ChatAssistant extends Component {
}
}
export default ChatAssistant;
export default withTranslation()(ChatAssistant);