Point groups of error codes to their individual pages.

This commit is contained in:
muzam1l
2022-08-09 17:00:30 +05:30
parent c336ff8334
commit 53c2104b94

View File

@@ -7,11 +7,18 @@ interface Props {
const ResultLink: FC<Props> = ({ result }) => { const ResultLink: FC<Props> = ({ result }) => {
if (!result) return null; if (!result) return null;
let href: string;
if (result === "tesSUCCESS") {
href = "https://xrpl.org/tes-success.html";
} else {
// Going shortcut here because of url structure, if that changes we will do it manually
href = `https://xrpl.org/${result.slice(0, 3)}-codes.html`;
}
return ( return (
<Link <Link
as="a" as="a"
title={result} title={result}
href={"https://xrpl.org/transaction-results.html"} href={href}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
> >