// Libs
// -----------------------------------------------------------------------------
import { DeleteFilled } from '@ant-design/icons';

// App
// -----------------------------------------------------------------------------
import {
  EnumButtonActions,
  TypeActionButtonsConfig,
} from 'components/DashboardTable/components/useActionsWithSelectedCards/types';
import { AccountsDashboardLocale } from './i18n';
import { EActionType } from 'components/DashboardTable/types';

type TypeActions = 'delete';

export const makeAccountsDashboardActions = (
  locale: AccountsDashboardLocale,
  handlers: {
    onCollectiveDelete: () => void;
  },
  hasSelected?: boolean,
): { [key in TypeActions]: TypeActionButtonsConfig } => {
  const { onCollectiveDelete } = handlers;

  return {
    delete: {
      actionType: EActionType.SpecificAction,
      hasSelected,
      name: 'delete',
      action: onCollectiveDelete,
      translationsKey: EnumButtonActions.Delete,
      icon: DeleteFilled,
      popoverMessage: locale.delete,
      confirmMessage: locale.deletionConfirmation,
    },
  };
};
