import Link from "next/link";
import { ReactElement } from "react";

type ButtonProps = {
  title: string;
  url: string;
  openInNewTab?: boolean;
};

export function RedirectButton({ title, url, openInNewTab }: ButtonProps): ReactElement {
  return (
    <div className="w-fit rounded-lg">
      <Link href={url} target={openInNewTab ? "_blank" : ""}>
        <p className="hover:text-primary transition-all">{title}</p>
      </Link>
    </div>
  );
}
