import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { useEffect, useState } from "react";
import { useEditContext } from "../client/editContext";
import { CommentHighlighting } from "./CommentHighlighting";
export function CommentHighlightings({ scale, iframe, }) {
    const editContext = useEditContext();
    const [comments, setComments] = useState([]);
    useEffect(() => {
        setComments(editContext?.comments || []);
    }, [editContext?.comments, editContext?.suggestedEdits]);
    return (_jsx(_Fragment, { children: comments
            .filter((x) => editContext?.showResolvedComments ? true : !x.isResolved)
            .map((comment) => (_jsx(CommentHighlighting, { iframe: iframe, scale: scale, comment: comment }, comment.id))) }));
}
//# sourceMappingURL=CommentHighlightings.js.map