Files
cosscom__coss/apps/origin/components/header-link.tsx
pasqualevitiello f9c0ecccbb coss.com - day 0
2025-10-10 16:54:13 +02:00

61 lines
1.3 KiB
TypeScript

import Link from "next/link"
import { RiArrowRightUpLine } from "@remixicon/react"
import { cn } from "@/registry/default/lib/utils"
export default function HeaderLink({
text,
href,
external = false,
className,
isNew = false,
}: {
text: string
href: string
external?: boolean
className?: string
isNew?: boolean
}) {
return (
<div className="flex items-start gap-1.5">
{external ? (
<a
className={cn(
"inline-flex gap-0.5 text-sm hover:underline",
className
)}
href={href}
target="_blank"
>
{text}
<span className="hidden sm:inline">
{" "}
<RiArrowRightUpLine
className="text-muted-foreground/80"
size={14}
aria-hidden="true"
/>
</span>
</a>
) : (
<>
<Link
href={href}
className={cn(
"inline-flex gap-0.5 text-sm hover:underline",
className
)}
>
{text}
</Link>
{isNew && (
<span className="text-xs text-[10px] font-medium text-muted-foreground/80 uppercase">
New
</span>
)}
</>
)}
</div>
)
}