import React, { Component } from "react"; import "../style/Highlight.css"; import type { T_LTWH } from "../types"; type Props = { position: { boundingRect: T_LTWH; rects: Array; }; onClick?: () => void; onMouseOver?: () => void; onMouseOut?: () => void; comment: { emoji: string; text: string; }; isScrolledTo: boolean; }; class Highlight extends Component { render() { const { position, onClick, onMouseOver, onMouseOut, comment, isScrolledTo, } = this.props; const { rects, boundingRect } = position; return (
{comment ? (
{comment.emoji}
) : null}
{rects.map((rect, index) => (
))}
); } } export default Highlight;