import { useEffect, useState } from 'react';
import { useToolbarCollectionSyncProps } from '../ToolbarCollection/useToolbarCollectionSyncProps';
import { isValidElement } from '../isValidElement';
export function useKanbanCollectionSyncProps(props) {
    const { state: kanban, dataExtension } = props;
    const state = kanban.toolbar;
    useToolbarCollectionSyncProps({
        ...props,
        state,
        isUsingDragAndDrop: false,
        isUsingBulkActionsToolbar: false,
        isUsingHorizontalScroll: false,
        isUsingFolders: false,
        isUsingTableVirtualization: false,
    });
    useState(() => {
        if (isValidElement(dataExtension)) {
            dataExtension.type.setDataExtensionOnTable(state, dataExtension.props);
        }
        else {
            dataExtension?.setDataExtensionOnTable(state);
        }
    });
    useEffect(() => {
        if (!dataExtension) {
            return;
        }
        (isValidElement(dataExtension)
            ? dataExtension.type
            : dataExtension).syncTableCollectionProps(state);
    }, []);
    return state;
}
//# sourceMappingURL=useKanbanCollectionSyncProps.js.map