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

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

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

export default CardSubtitle;
