From acd3dcd9a6fb943d5bd385185af293ac7bf9efd7 Mon Sep 17 00:00:00 2001 From: Fraser Date: Sun, 16 Apr 2023 21:15:10 -0400 Subject: [PATCH] only link if href not empty --- web/src/pages/index.tsx | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/web/src/pages/index.tsx b/web/src/pages/index.tsx index a770c5d..ac7a318 100644 --- a/web/src/pages/index.tsx +++ b/web/src/pages/index.tsx @@ -60,29 +60,34 @@ const ShowCitation: React.FC<{citation: Citation, i: number}> = ({citation, i}) c_str += " - " + citation.date; return ( - + [{i + 1}]

{c_str}

-
+ ); }; const ShowInTextCitation: React.FC<{citation: Citation, i: number}> = ({citation, i}) => { return ( - + [{i + 1}] - + ); }; -const ShowEntry: React.FC<{entry: Entry}> = ({entry}) => { - - // user message - if (entry.role === "user") { - return (

{entry.content}

); - } +const A: React.FC<{href: string, className?: string, children: React.ReactNode}> = ({href, className, children}) => { + return href && href !== "" ? ( + + {children} + + ) : ( + + {children} + + ); +}