From 979285e37999931c82f0a322bda4d68ac83de1e6 Mon Sep 17 00:00:00 2001 From: ejmg Date: Wed, 24 Jan 2024 13:47:56 -0600 Subject: [PATCH] fixed search results linking for identifiers --- src/components/SearchResultsTable/columns.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/SearchResultsTable/columns.tsx b/src/components/SearchResultsTable/columns.tsx index e05d066..c1ea85a 100644 --- a/src/components/SearchResultsTable/columns.tsx +++ b/src/components/SearchResultsTable/columns.tsx @@ -4,6 +4,7 @@ import { type ColumnDef } from "@tanstack/react-table"; // import Link from "next/link"; import { type RelatedQuery, type SearchResult } from "."; +import Link from "next/link"; type SearchResultsColumns = SearchResult; @@ -22,7 +23,9 @@ export const columns : Array> = [ header: () =>
ID
, cell: ({ row }) => { const identifier : string = row.getValue("identifier"); - return

{identifier}

; + const kind : string = row.getValue("kind"); + const prefix = kind === "TX_HASH" ? "/transaction" : (kind === "BLOCK_HEIGHT" ? "/block" : (kind === "IBC_CLIENT" ? "/ibc/client" : (kind === "IBC_CHANNEL" ? "/ibc/channel" : "/ibc/connection"))); + return

{identifier}

; }, }, { @@ -42,12 +45,13 @@ export const columns : Array> = [ // return {txHash}; // } if (related !== undefined) { - console.log(related); - console.log(related.map); return (
    {/* {related.map(({ type, indentifier }, i) =>
  • {type} : {indentifier}
  • )} */} - {related.map(({ type, identifier }, i) => (
    {type}: {identifier}
    ))} + {related.map(({ type, identifier }, i) => { + return
  • {type}:

    {identifier}

  • ; + }) + }
); }