import * as React from "react";
import { IGXE } from "@intelligentgraphics/igd.core";
import { usePropertyEditorContext } from "./Context";
export const usePropertyGroups = (properties) => {
    const context = usePropertyEditorContext();
    return React.useMemo(() => IGXE.createPropertyGroups(properties.map(property => context.properties[property])), [properties]);
};
const PropertyGroups = props => {
    const groups = usePropertyGroups(props.properties);
    return props.children({
        groups,
    });
};
PropertyGroups.displayName = "PropertyGroups";
export default PropertyGroups;
