otterscan/src/components/AddressLink.tsx

21 lines
480 B
TypeScript
Raw Normal View History

2021-07-01 18:21:40 +00:00
import React from "react";
import { NavLink } from "react-router-dom";
type AddressLinkProps = {
address: string;
text?: string;
};
const AddressLink: React.FC<AddressLinkProps> = ({ address, text }) => (
<NavLink
className="text-link-blue hover:text-link-blue-hover font-address truncate"
to={`/address/${address}`}
>
2021-07-06 05:04:46 +00:00
<p className="truncate" title={text ?? address}>
2021-07-01 18:21:40 +00:00
{text ?? address}
</p>
</NavLink>
);
export default React.memo(AddressLink);