diff --git a/packages/mco/components/drpolicy-list-page/helper.ts b/packages/mco/components/drpolicy-list-page/helper.ts index ef31ea699..b6ae2a0bb 100644 --- a/packages/mco/components/drpolicy-list-page/helper.ts +++ b/packages/mco/components/drpolicy-list-page/helper.ts @@ -1,3 +1,4 @@ +import { CustomKebabItem } from '@odf/shared/kebab'; import { ModalKeys } from '@odf/shared/modals/types'; import classNames from 'classnames'; import { TFunction } from 'i18next'; @@ -79,20 +80,18 @@ export const kebabActionItems = ( appsLoaded, appsLoadedError, t -) => [ +): CustomKebabItem[] => [ { key: ModalKeys.DELETE, value: Actions.DELETE_DR_POLICY, - props: { - description: !!appsCount - ? t('Cannot delete while connected to an application.') - : '', - isDisabled: !( - canDeleteDRPolicy && - appsLoaded && - !appsLoadedError && - !appsCount - ), - }, + description: !!appsCount + ? t('Cannot delete while connected to an application.') + : '', + isDisabled: !( + canDeleteDRPolicy && + appsLoaded && + !appsLoadedError && + !appsCount + ), }, ]; diff --git a/packages/shared/src/kebab/kebab.tsx b/packages/shared/src/kebab/kebab.tsx index 1902116df..0c33fcc22 100644 --- a/packages/shared/src/kebab/kebab.tsx +++ b/packages/shared/src/kebab/kebab.tsx @@ -25,6 +25,8 @@ import { referenceForModel } from '../utils'; export type CustomKebabItem = { key: string; value: string; + isDisabled?: boolean; + description?: React.ReactNode; component?: React.LazyExoticComponent; }; @@ -180,7 +182,13 @@ export const Kebab: React.FC & KebabStaticProperties = ({ const { overrides, custom } = Object.entries(customResolved).reduce( (acc, [k, obj]) => { const dropdownItem = ( - + {obj?.value} );