import { useRef, type RefObject } from "react"; import { Stage, Layer, Image, Rect } from "react-konva"; import { useCreateVideoSnapshot } from "../hooks/useGetvideoSnapshots"; const VideoFeedGridPainter = () => { const { latestBitmapRef } = useCreateVideoSnapshot(); const isDrawing = useRef(false); const rows = 100; const cols = 100; const size = 10; const gap = 0; const squares = []; for (let row = 0; row < rows; row++) { for (let col = 0; col < cols; col++) { squares.push( , ); } } const getCoords = (e) => { isDrawing.current = true; }; const handleMouseMove = (e) => { if (!isDrawing.current) { return; } const pos = e.target.getStage().getPointerPosition(); console.log(pos); }; const handleMouseUp = () => { isDrawing.current = false; }; const draw = (bmp: RefObject) => { if (!bmp || !bmp.current) { return; } else { const frame = bmp.current; return frame; } }; return ( {squares} ); }; export default VideoFeedGridPainter;