Setting the file. One moment.
Subchapter 2.19
references/auto-patterns-dashboard/entity-page-actions.mdMarkdown2 KBView on GitHub
interface EntityPageConfig {
entityPage: {
actions: {
moreActions: (CustomActionItem | DividerItem)[];
};
};
}
interface CustomActionItem {
id: string; // Matches resolver name
type: 'custom';
label: string;
biName: string; // MANDATORY
}
interface DividerItem {
type: 'divider';
}
// Resolver Type
type CustomEntityPageActionResolver = (params: {
actionParams: {
entity: any; // Current entity data
form: UseFormReturn; // react-hook-form instance
};
sdk: AutoPatternsSDK;
}) => ResolvedAction;'edit' THEN ONLY moreActions is supported (primaryActions forbidden).type: 'custom' THEN id MUST match exported resolver name.type: 'divider' THEN NO other properties allowed.'custom' and 'divider' are valid action types in moreActions. There is NO built-in 'duplicate', 'copy', 'clone', 'archive', 'export', or similar action type.type: 'custom' with a resolver implementation.moreActions array for Edit Mode.biName for every action.ResolvedAction object (see resolved_action.md).errorHandler for Wix API calls.primaryActions or secondaryActions in Edit Mode.// Config
{
moreActions: [
{ id: 'sendEmail', type: 'custom', label: 'Send Email', biName: 'send-email-action' },
{ type: 'divider' },
{ id: 'archive', type: 'custom', label: 'Archive', biName: 'archive-action' }
]
}
// components/actions/sendEmail.tsx (use .tsx because it contains JSX icon)
export const sendEmail: CustomEntityPageActionResolver = ({ actionParams, sdk }) => {
return {
label: 'Send Email',
icon: <EmailIcon />,
biName: 'send-email-action',
onClick: () => {
// Logic here
}
};
};