import { cn } from "@/lib/utils"; type AdaptiveWordTextProps = { text: string; variant: "hero" | "option"; }; export function AdaptiveWordText({ text, variant }: AdaptiveWordTextProps) { const displayText = text.trim().replace(/\s+/g, "\n"); const compactLength = text.replace(/\s+/g, "").length; const isVeryLongSingleWord = compactLength > 16 && !/\s/.test(text.trim()); const size = compactLength <= 6 ? "large" : compactLength <= 10 ? "medium" : "small"; const sizeClass = { hero: { large: "text-[clamp(52px,7vw,82px)]", medium: "text-[clamp(42px,5.6vw,64px)]", small: "text-[clamp(28px,4.2vw,46px)]", }, option: { large: "text-[clamp(30px,4vw,48px)]", medium: "text-[clamp(25px,3.2vw,38px)]", small: "text-[clamp(20px,2.6vw,30px)]", }, }[variant][size]; return ( {displayText} ); }