import { Link, Typography } from "@material-ui/core"; import { ReactNode } from "react"; import InfoBox from "./InfoBox"; export type TransactionInfoBoxProps = { title: string; txId: string | null; explorerUrlCreator: ((txId: string) => string) | null; additionalContent: ReactNode; loading: boolean; icon: JSX.Element; }; export default function TransactionInfoBox({ title, txId, additionalContent, icon, loading, explorerUrlCreator, }: TransactionInfoBoxProps) { return ( {txId ?? "Transaction ID not available"} } loading={loading} additionalContent={ <> {additionalContent} {explorerUrlCreator != null && txId != null && ( // Only show the link if the txId is not null and we have a creator for the explorer URL View on explorer )} } icon={icon} /> ); }