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

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

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

Card.displayName = "Card";

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

export default Card;
