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

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

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

export default CardText;
