mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
30 lines
603 B
TypeScript
30 lines
603 B
TypeScript
import React from 'react';
|
|
|
|
import { Link } from 'toolkit/next/link';
|
|
import { makePrettyLink } from 'toolkit/utils/url';
|
|
import IconSvg from 'ui/shared/IconSvg';
|
|
|
|
interface Props {
|
|
url?: string | undefined;
|
|
}
|
|
|
|
const WebsiteLink = ({ url }: Props) => {
|
|
if (!url) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<Link
|
|
external
|
|
noIcon
|
|
href={ url }
|
|
className="inline-flex items-center gap-x-1 mt-3"
|
|
>
|
|
<IconSvg name="link" className="w-5 h-5 text-[var(--color-icon-primary)]"/>
|
|
<span>{ makePrettyLink(url)?.domain }</span>
|
|
</Link>
|
|
);
|
|
};
|
|
|
|
export default WebsiteLink;
|