import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { useEffect, useState } from "react";
import { useEditContext } from "../client/editContext";
import { SuggestionHighlighting } from "./SuggestionHighlighting";
export function SuggestionHighlightings({ scale, iframe, }) {
    const editContext = useEditContext();
    const [suggestions, setSuggestions] = useState([]);
    useEffect(() => {
        setSuggestions(editContext?.suggestedEdits.filter((x) => x.status === "pending") || []);
    }, [editContext?.comments, editContext?.suggestedEdits]);
    return (_jsx(_Fragment, { children: editContext?.showSuggestedEdits &&
            suggestions
                .filter((x) => x.status !== "applied" && x.status !== "rejected")
                .map((suggestion) => (_jsx(SuggestionHighlighting, { iframe: iframe, scale: scale, suggestion: suggestion }, suggestion.id))) }));
}
//# sourceMappingURL=SuggestionHighlightings.js.map