import React from "react";
import cn from "classnames";
import PropTypes from "prop-types";
import ICardContent from "./card-content";

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

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

export default CardHeader;
