From e82a8d0a65965ce312a39ffd7c66cc997d9eb453 Mon Sep 17 00:00:00 2001 From: alisman Date: Fri, 10 Jan 2025 12:03:35 -0500 Subject: [PATCH] Improve handling of case without resources --- .../components/resources/ResourceTable.tsx | 69 ++++++++++--------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/src/shared/components/resources/ResourceTable.tsx b/src/shared/components/resources/ResourceTable.tsx index e53a3fa197c..7ac2e3ead12 100644 --- a/src/shared/components/resources/ResourceTable.tsx +++ b/src/shared/components/resources/ResourceTable.tsx @@ -53,7 +53,9 @@ const ResourceTable = observer( }, })); - return ( + return resourceTable.data.length === 0 ? ( +

There are no resources for this sample.

+ ) : ( @@ -64,42 +66,45 @@ const ResourceTable = observer( - - { resourceTable.data.length === 0 ? ( + {resourceTable.data.length === 0 ? ( - ) : (resourceTable.data.map(resource => ( - - {sampleId && } - - - - - ))} + ) : ( + resourceTable.data.map(resource => ( + + {sampleId && } + + + + + )) + )}
There are no results
{sampleId} - openResource(resource)}> - {icon(resource)} - {resource.resourceDefinition.displayName || - resource.url} - - - - - Open in new window - - {resource.resourceDefinition.description}
{sampleId} + openResource(resource)}> + {icon(resource)} + {resource.resourceDefinition + .displayName || resource.url} + + + + + Open in new window + + + {resource.resourceDefinition.description} +
);