import React from "react"; import { Link } from "react-router-dom"; import { TransactionSignature } from "@solana/web3.js"; import { clusterPath } from "utils/url"; import { Copyable } from "./Copyable"; type Props = { signature: TransactionSignature; alignRight?: boolean; link?: boolean; truncate?: boolean; truncateChars?: number; }; export function Signature({ signature, alignRight, link, truncate, truncateChars, }: Props) { let signatureLabel = signature; if (truncateChars) { signatureLabel = signature.slice(0, truncateChars) + "…"; } return (
{link ? ( {signatureLabel} ) : ( signatureLabel )}
); }