import { RiArrowDropRightLine } from "@remixicon/react";
import React from "react";
import Link from "next/link";

function Title({
  children,
  href,
}: {
  children: React.ReactNode;
  href?: string;
}) {
  return (
    <div className="flex justify-between items-end mb-8 mt-6 border-b border-zinc-300 pb-2">
      <div>
        <h2 className="font-bold text-lg md:text-xl lg:text-2xl">{children}</h2>
      </div>
      {href && (
        <Link
          prefetch
          className="text-primary font-label-md flex items-center gap-1 hover:underline"
          href={href}
        >
          See all
          <RiArrowDropRightLine />
        </Link>
      )}
    </div>
  );
}

export default Title;
