"use client"; import { ChevronRight } from "lucide-react"; import { useRef } from "react"; interface EditorProps { content: string; setContent: (v: string) => void; } export default function Editor({ content, setContent }: EditorProps) { const textareaRef = useRef(null); const lineNumbersRef = useRef(null); const handleScroll = () => { if (lineNumbersRef.current && textareaRef.current) { lineNumbersRef.current.scrollTop = textareaRef.current.scrollTop; } }; return (
{/* Numéros de lignes */}
{content.split("\n").map((_, i) => (
{i === 0 && } {i + 1}
))}
{/* Zone d’édition */}