import React from "react";
import cn from "classnames";
import PropTypes from "prop-types";

export interface ICardBodyProps {
  className?: string;
  children?: React.ReactNode | React.ReactNode[];
  ["data-testid"]?: string;
}

const CardBody: React.FC<ICardBodyProps> = ({ className, children, ...props }) => {
  const dataTestId = props["data-testid"] || "honey-ui-card-body";
  return (
    <div {...props} data-testid={dataTestId} className={cn("card-body", className)}>
      {children}
    </div>
  );
};

CardBody.displayName = "Card Body";
CardBody.propTypes = {
  className: PropTypes.string,
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
};

export default CardBody;
