fix: remove unused React import, use Link for internal badge hrefs

This commit is contained in:
2026-03-31 02:35:58 +02:00
parent 86d76d39ac
commit 04ada8ad51

View File

@@ -1,4 +1,4 @@
import React from "react";
import Link from "next/link";
interface BadgeProps {
href?: string;
@@ -17,12 +17,19 @@ function Badge({ href, children, style }: BadgeProps) {
);
if (href) {
if (href.startsWith("http")) {
return (
<a href={href} target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
{base}
</a>
);
}
return (
<Link href={href} className="hover:opacity-80 transition-opacity">
{base}
</Link>
);
}
return base;
}