import { cn } from "@/utils/cn";

const Heading = ({
  title,
  description,
  className = "text-center",
}: {
  title: string;
  description?: string;
  className?: string;
}) => {
  return (
    <div className={cn(className)}>
      <h2 className="mb-3  text-[clamp(1.75rem,5vw,4.375rem)] font-bold leading-[1.15] text-ink wrap-break-word sm:mb-5 text-balance">
        {title}
      </h2>
      {description ? (
        <p
          className={cn(
            "max-w-230 px-1 text-base leading-relaxed wrap-break-word sm:text-lg md:text-xl lg:text-2xl",
            className === "text-center"
              ? "mx-auto text-ink/80"
              : "mx-auto text-muted lg:mx-0",
          )}
        >
          {description}
        </p>
      ) : null}
    </div>
  );
};

export default Heading;
