fun improvements #1
@@ -1,4 +1,4 @@
|
||||
import React from "react";
|
||||
import Link from "next/link";
|
||||
|
||||
interface BadgeProps {
|
||||
href?: string;
|
||||
@@ -17,10 +17,17 @@ 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 (
|
||||
<a href={href} target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
|
||||
<Link href={href} className="hover:opacity-80 transition-opacity">
|
||||
{base}
|
||||
</a>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
return base;
|
||||
|
||||
Reference in New Issue
Block a user