import React, { ReactNode } from "react";
import styles from "./SecondaryCta.module.css";

type SecondaryCtaProps = {
  label?: ReactNode;
  className?: string;
  onDarkBackground?: boolean;
};

const SecondaryCta = ({
  label = "Read more",
  className = "",
  onDarkBackground = false,
}: SecondaryCtaProps) => {
  const classes = [
    styles.secondaryCta,
    onDarkBackground ? styles.onDarkBackground : "",
    className,
  ]
    .join(" ")
    .trim();

  return (
    <span className={classes}>
      <span className={styles.label}>{label}</span>
      <span className={styles.badge}>
        <svg
          className={styles.icon}
          xmlns="http://www.w3.org/2000/svg"
          height="24"
          viewBox="0 -960 960 960"
          width="24"
          aria-hidden="true"
        >
          <path d="M647-440H160v-80h487L423-744l57-56 320 320-320 320-57-56 224-224Z" />
        </svg>
      </span>
    </span>
  );
};

export default SecondaryCta;
