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