import Link from "next/link";
import type { ReactNode } from "react";
export function Arrow() {
  return (
    <span className="arrow" aria-hidden="true">
      ↗
    </span>
  );
}
export function ButtonLink({
  children,
  href,
  variant = "",
}: {
  children: ReactNode;
  href: string;
  variant?: string;
}) {
  const className = `button ${variant}`;
  return href.endsWith(".pdf") ? (
    <a className={className} href={href}>
      {children}
      <Arrow />
    </a>
  ) : (
    <Link className={className} href={href}>
      {children}
      <Arrow />
    </Link>
  );
}
export function Eyebrow({ children }: { children: ReactNode }) {
  return <div className="eyebrow">{children}</div>;
}
export function PageHero({
  title,
  description,
  kicker,
}: {
  title: string;
  description: string;
  kicker: string;
}) {
  return (
    <section className="page-hero">
      <div className="wrap">
        <div className="breadcrumb">
          <Link href="/">Home</Link>
          <span>/</span>
          {title}
        </div>
        <Eyebrow>{kicker}</Eyebrow>
        <h1>{title}</h1>
        <p>{description}</p>
      </div>
    </section>
  );
}
