import { ComponentType } from 'react';

export type TypeButton = {
  type: 'upload' | 'download' | 'customButton';
  key: string;
  translation: string;
  action: (file?: FormData) => void;
  fileName?: string;
  icon?: ComponentType;
  disabled?: boolean;
};

export type Props = {
  buttonsConfig: Array<TypeButton | TypeButton[]>;
};

export type TypeDropDownButtonConfig = {
  upload: ({
    key,
    messages,
    action,
    fileName,
    icon,
    disabled,
  }: {
    key: string;
    messages: string;
    action: () => void;
    fileName: string;
    icon?: ComponentType;
    disabled?: boolean;
  }) => { key: string; label: JSX.Element };
  download: ({
    key,
    messages,
    action,
    icon,
    disabled,
  }: {
    key: string;
    messages: string;
    action: () => void;
    icon?: ComponentType;
    disabled?: boolean;
  }) => { key: string; label: JSX.Element };
  customButton: ({
    key,
    messages,
    action,
    icon,
    disabled,
  }: {
    key: string;
    messages: string;
    action: () => void;
    icon?: ComponentType;
    disabled?: boolean;
  }) => {
    key: string;
    label: JSX.Element;
  };
};
