import React, { useEffect } from 'react';
import { observer } from 'mobx-react-lite';
import { CollectionTableContentCard } from '../CollectionTable/CollectionTableContentCard';
import { useWixPatternsRouter } from '../../providers/WixPatternsRouterProvider';
function _NestedTableContent(props) {
    const { state, children } = props;
    const { showLoadingState, showErrorState } = state;
    const showTableContent = !showLoadingState && !showErrorState;
    const router = useWixPatternsRouter();
    useEffect(() => {
        // Pass isUsingCache: true to prevent another fetch
        return state.init({ isUsingCache: router?.isUsingCache });
    }, [router?.isUsingCache]);
    return (React.createElement(React.Fragment, null, showTableContent && (React.createElement(CollectionTableContentCard, null, children))));
}
export const NestedTableContent = observer(_NestedTableContent);
//# sourceMappingURL=NestedTableContent.js.map