import React from 'react';
/**
 * Higher-Order Component that takes a section based component as an argument and returns a new component
 * that checks if the 'section' prop is defined before rendering the SectionComponent.
 * If the 'section' prop is undefined, it returns an empty element.
 *
 * @template P - Props of the original SectionComponent
 * @param {React.FC<P>} SectionComponent - The original component that will be wrapped
 * @returns {React.FC<P | (Omit<P, 'section'> & { section?: undefined })>} - The wrapped component
 * @example
 * const CheckedComponent = SectionChecker(({section, ...props}) => {
 *   return <div>{section.title}</div>
 * })
 */
export const SectionChecker = (SectionComponent) => {
    const CheckedSectionComponent = (props) => {
        return !props.section ? <></> : <SectionComponent {...props}/>;
    };
    return CheckedSectionComponent;
};
//# sourceMappingURL=SectionChecker.jsx.map