import React from 'react';
export const mapActions = (args)=>{
    const { collectionConfig, globalConfig } = args;
    const editViews = (collectionConfig || globalConfig)?.admin?.components?.views?.Edit;
    const listActions = typeof collectionConfig?.admin?.components?.views?.List === 'object' ? collectionConfig?.admin?.components?.views?.List?.actions : undefined;
    const result = {
        Edit: {},
        List: []
    };
    if (editViews) {
        Object.entries(editViews).forEach(([key, view])=>{
            if (typeof view === 'object' && 'actions' in view) {
                view.actions.forEach((action)=>{
                    const Action = action;
                    if (typeof Action === 'function') {
                        result.Edit[key] = [
                            ...result[key] || [],
                            /*#__PURE__*/ React.createElement(Action, null)
                        ];
                    }
                });
            }
        });
    }
    if (listActions) {
        listActions.forEach((action)=>{
            const Action = action;
            if (typeof Action === 'function') {
                result.List = [
                    ...result.List,
                    /*#__PURE__*/ React.createElement(Action, null)
                ];
            }
        });
    }
    return result;
};

//# sourceMappingURL=mapActions.js.map