export enum ExplorerDataType {
	TRANSACTION = "transaction",
	TOKEN = "token",
	ADDRESS = "address",
	BLOCK = "block",
}

export const getExplorerLink = (
	baseUrl: string,
	data: string,
	type: ExplorerDataType,
): string => {
	if (!data) return "";
	switch (type) {
		case ExplorerDataType.TRANSACTION: {
			return `${baseUrl}/tx/${data}`;
		}
		case ExplorerDataType.TOKEN: {
			return `${baseUrl}/token/${data}`;
		}
		case ExplorerDataType.BLOCK: {
			return `${baseUrl}/block/${data}`;
		}
		default: {
			return `${baseUrl}/address/${data}`;
		}
	}
};
