"use client" import { useState } from "react" import { cn } from "@/lib/utils" const MAX_ROWS = 8 const MAX_COLS = 10 export function DocsInsertTablePicker({ onInsert, }: { onInsert: (rows: number, cols: number) => void }) { const [hover, setHover] = useState({ rows: 0, cols: 0 }) const label = hover.rows > 0 && hover.cols > 0 ? `${hover.cols} x ${hover.rows}` : "Insérer un tableau" return (
setHover({ rows: 0, cols: 0 })} >
{Array.from({ length: MAX_ROWS }, (_, rowIndex) => Array.from({ length: MAX_COLS }, (_, colIndex) => { const row = rowIndex + 1 const col = colIndex + 1 const active = row <= hover.rows && col <= hover.cols return (

{label}

) }