import cx from "classnames";
import React from "react";

interface TestimonialProps {
  className?: string;
  children?: React.ReactNode;
  color?: "default" | "orange";
  isDiv?: boolean;
  [key: string]: any;
}

const CLASS_ROOT = "testimonial";

export const Testimonial: React.FC<TestimonialProps> = ({
  className,
  children,
  color = "default",
  isDiv = false,
  ...other
}) => {
  const Tag = isDiv ? "div" : "p";

  const classes = cx(
    CLASS_ROOT,
    {
      [`testimonial--${color}`]: color === "orange",
    },
    className,
  );

  return (
    <Tag className={classes} {...other}>
      {children}
    </Tag>
  );
};

Testimonial.displayName = "Testimonial";
