diff --git a/src/components/ChatInput.tsx b/src/components/ChatInput.tsx index b0abde5..55cff41 100644 --- a/src/components/ChatInput.tsx +++ b/src/components/ChatInput.tsx @@ -1,6 +1,7 @@ import { useState, useRef, useEffect, useCallback, lazy, Suspense } from 'react'; -import { Send, Square, Paperclip, X, FileText, Eye, EyeOff } from 'lucide-react'; +import { Send, Square, Paperclip, X, FileText, Eye, EyeOff, Highlighter } from 'lucide-react'; import { useT } from '../hooks/useLocale'; +import { HighlightedTextarea } from './HighlightedTextarea'; const ReactMarkdown = lazy(() => import('react-markdown')); const remarkGfm = import('remark-gfm').then(m => m.default); @@ -91,6 +92,7 @@ export function ChatInput({ onSend, onAbort, isGenerating, disabled, sessionKey const [files, setFiles] = useState([]); const [isDragOver, setIsDragOver] = useState(false); const [showPreview, setShowPreview] = useState(() => localStorage.getItem('pinchchat-md-preview') === '1'); + const [highlightEnabled, setHighlightEnabled] = useState(() => localStorage.getItem('pinchchat-syntax-hl') !== '0'); const textareaRef = useRef(null); const fileInputRef = useRef(null); @@ -283,6 +285,15 @@ export function ChatInput({ onSend, onAbort, isGenerating, disabled, sessionKey > {showPreview ? : } + {/* Syntax highlight toggle */} + -