[FRONT COMPONENTS] Add loader to command menu items (#18165)
## PR description - Add a loader to the command menu items when the action is running. - Add a new method `closeSidePanel` to the front component host api. ## Video QA https://github.com/user-attachments/assets/c20b592a-6e4c-4cab-b5da-4cb2316acc7c
This commit is contained in:
+6
-3
@@ -2,6 +2,7 @@ import { Action } from '@/action-menu/actions/components/Action';
|
||||
import { ActionScope } from '@/action-menu/actions/types/ActionScope';
|
||||
import { ActionType } from '@/action-menu/actions/types/ActionType';
|
||||
import { ActionMenuContext } from '@/action-menu/contexts/ActionMenuContext';
|
||||
import { HeadlessFrontComponentAction } from '@/action-menu/actions/display/components/HeadlessFrontComponentAction';
|
||||
import { useOpenFrontComponentInCommandMenu } from '@/command-menu/hooks/useOpenFrontComponentInCommandMenu';
|
||||
import { contextStoreCurrentObjectMetadataItemIdComponentState } from '@/context-store/states/contextStoreCurrentObjectMetadataItemIdComponentState';
|
||||
import { contextStoreIsPageInEditModeComponentState } from '@/context-store/states/contextStoreIsPageInEditModeComponentState';
|
||||
@@ -76,11 +77,13 @@ const buildActionFromItem = ({
|
||||
isPinned,
|
||||
Icon,
|
||||
shouldBeRegistered: () => true,
|
||||
component: (
|
||||
<Action
|
||||
component: isHeadless ? (
|
||||
<HeadlessFrontComponentAction
|
||||
frontComponentId={item.frontComponentId}
|
||||
onClick={handleClick}
|
||||
closeSidePanelOnCommandMenuListActionExecution={isHeadless}
|
||||
/>
|
||||
) : (
|
||||
<Action onClick={handleClick} />
|
||||
),
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user