import React, { ReactElement } from "react";
import { BlockAction } from "./BlockAction";
import { BlockActionControl } from "./BlockActionControl";
import { BlockActionIndicator } from "./BlockActionIndicator";
import { CloneElementWithClassName } from "./CloneElementWithClassName";

export interface BlockActionOverrideProps {
  /** 1 and only one single element */
  children: ReactElement;
  className?: string;
  [key: string]: any;
}

export { BlockAction, BlockActionControl };

const BlockActionOverride: React.FC<BlockActionOverrideProps> = (props) => (
  <CloneElementWithClassName {...props} className="block-action__override" />
);

BlockActionOverride.displayName = "BlockActionOverride";

export { BlockActionIndicator, BlockActionOverride };
