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

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

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

export default CardTitle;
