diff --git a/src/components/ui/code-editor/CodeEditor.tsx b/src/components/ui/code-editor/CodeEditor.tsx index a457a09f9f..9e2e174045 100644 --- a/src/components/ui/code-editor/CodeEditor.tsx +++ b/src/components/ui/code-editor/CodeEditor.tsx @@ -14,8 +14,9 @@ export const CodeEditor = forwardRef< onChange?: (value: string) => void minHeight?: string className?: string + padding?: number } ->(({ content, language, onChange, minHeight, className }, ref) => { +>(({ content, language, onChange, minHeight, className, padding = 0 }, ref) => { const [highlighterValue, setHighlighterValue] = useState(content) useEffect(() => { @@ -31,14 +32,21 @@ export const CodeEditor = forwardRef< 'relative [&_*]:!font-mono [&_*]:!text-base [&_*]:!leading-[1.5]', className, )} + style={ + { + padding: `${padding}px`, + '--padding': `${padding * 2}px`, + } as any + } contentEditable={false} >