diff --git a/src/components/Folder/index.tsx b/src/components/Folder/index.tsx index 5cfa7c2b..c4abbdfc 100644 --- a/src/components/Folder/index.tsx +++ b/src/components/Folder/index.tsx @@ -10,9 +10,6 @@ import { ChevronRight, ChevronDown, AlertTriangle, - ZoomIn, - ZoomOut, - RotateCcw, } from 'lucide-react'; import { toast } from 'sonner'; import { Button } from '@/components/ui/button'; @@ -24,6 +21,7 @@ import { proxyFetchGet } from '@/api/http'; import { useTranslation } from 'react-i18next'; import useChatStoreAdapter from '@/hooks/useChatStoreAdapter'; import DOMPurify from 'dompurify'; +import { ZoomControls } from './ZoomControls'; // Type definitions interface FileTreeNode { @@ -549,22 +547,22 @@ export default function Folder({ data }: { data?: Agent }) { {selectedFile?.type === 'html' && !isShowSourceCode && htmlHasScripts && !htmlScriptsApproved && ( { setHtmlScriptsApproved(true); - toast.success('Scripts approved. Rendering with full functionality.', { + toast.success(t('chat.scripts-approved'), { duration: 3000, }); }} > - Safe to Run + {t('chat.safe-to-run')} )} {selectedFile?.type === 'html' && !isShowSourceCode && htmlScriptsApproved && htmlHasScripts && ( - Scripts running + {t('chat.scripts-running')} )} void; }) { + const { t } = useTranslation(); const [processedHtml, setProcessedHtml] = useState(''); const [hasScripts, setHasScripts] = useState(false); const [rawHtmlWithScriptsCache, setRawHtmlWithScriptsCache] = useState(''); @@ -766,7 +765,7 @@ function HtmlRenderer({ hasShownWarningRef.current = selectedFile.path; setHasScripts(true); onScriptsDetected(true); - toast.warning('HTML render found related scripts. Make sure scripts are safe to run.', { + toast.warning(t('chat.scripts-warning'), { duration: 5000, icon: , }); @@ -1128,22 +1127,14 @@ function HtmlRenderer({ }; return ( - - {/* Toolbar with zoom controls */} - - - - - - {zoom}% - - - - - - - - + + {/* Floating notch-style zoom controls */} + {/* Content area with zoom */}