diff --git a/web/src/components/api-service/embed-modal/index.less b/web/src/components/api-service/embed-modal/index.less index 2c85068ca..665d50c67 100644 --- a/web/src/components/api-service/embed-modal/index.less +++ b/web/src/components/api-service/embed-modal/index.less @@ -19,3 +19,6 @@ color: white; .darkBg(); } +.optionContainer { + padding: 10px; +} diff --git a/web/src/components/api-service/embed-modal/index.tsx b/web/src/components/api-service/embed-modal/index.tsx index 534c71109..2bd4dbaef 100644 --- a/web/src/components/api-service/embed-modal/index.tsx +++ b/web/src/components/api-service/embed-modal/index.tsx @@ -3,10 +3,22 @@ import HightLightMarkdown from '@/components/highlight-markdown'; import { SharedFrom } from '@/constants/chat'; import { useTranslate } from '@/hooks/common-hooks'; import { IModalProps } from '@/interfaces/common'; -import { Card, Modal, Tabs, TabsProps, Typography } from 'antd'; +import { + Card, + Checkbox, + Flex, + Form, + Modal, + Select, + Tabs, + TabsProps, + Typography, +} from 'antd'; +import { useState } from 'react'; import { useIsDarkTheme } from '@/components/theme-provider'; import { cn } from '@/lib/utils'; +import { languageOptions } from '@/locales/config'; import styles from './index.less'; const { Paragraph, Link } = Typography; @@ -27,10 +39,26 @@ const EmbedModal = ({ const { t } = useTranslate('chat'); const isDarkTheme = useIsDarkTheme(); + const [visibleAvatar, setVisibleAvatar] = useState(false); + const [locale, setLocale] = useState(''); + + const generateIframeSrc = () => { + let src = `${location.origin}/chat/share?shared_id=${token}&from=${form}&auth=${beta}`; + if (visibleAvatar) { + src += '&visible_avatar=1'; + } + if (locale) { + src += `&locale=${locale}`; + } + return src; + }; + + const iframeSrc = generateIframeSrc(); + const text = ` ~~~ html