import React from 'react';
import { observer } from 'mobx-react-lite';
import { Box, Loader } from '@wix/design-system';
import { ErrorState } from '../ErrorState';
import { CollectionEmptyState } from '../EmptyState/CollectionEmptyState';
function _NestedTableRowPlaceholderStates(props) {
    const { state } = props;
    const { initTask, showLoadingState, showEmptyState, showErrorState, errorStatus, } = state;
    let child;
    if (initTask.status.isError) {
        child = (React.createElement(ErrorState, { state: state, errorStatus: initTask.errorStatus, dataHook: "error-state", image: undefined }));
    }
    else if (showLoadingState) {
        child = (React.createElement(Box, { padding: "12px" },
            React.createElement(Loader, { dataHook: "loading-state", size: "small" })));
    }
    else if (showErrorState && errorStatus) {
        child = (React.createElement(ErrorState, { state: state, dataHook: "error-state", image: undefined }));
    }
    else if (showEmptyState) {
        child = (React.createElement(CollectionEmptyState, { dataHook: "empty-state", image: null, addNewCta: {
                onClick: () => {
                    state.levelDescriptor.onAddNewClick?.();
                },
            } }));
    }
    return React.createElement(React.Fragment, null, child);
}
export const NestedTableRowPlaceholderStates = observer(_NestedTableRowPlaceholderStates);
//# sourceMappingURL=NestedTableRowPlaceholderStates.js.map