import { useMemo } from "react";

interface UseSocketScanLinkProps {
	txHash?: string;
	type: "tx" | "address";
}

export const useSocketScanLink = ({ txHash, type }: UseSocketScanLinkProps) => {
	const socketScanLink = useMemo(() => {
		if (!txHash) return "";

		const baseUrl = "https://socketscan.io";
		return baseUrl.concat("/", type, "/", txHash);
	}, [txHash, type]);

	return { socketScanLink };
};
