1
1
import React from "react" ;
2
+ import { Link as DXLink } from "@databiosphere/findable-ui/lib/components/Links/components/Link/link" ;
2
3
import { TaxonomyNode } from "./data" ;
3
4
import { HierarchyNode } from "d3" ;
4
5
import { RoundedPaper } from "@databiosphere/findable-ui/lib/components/common/Paper/paper.styles" ;
5
- import { ChevronRightRounded , ArrowBackRounded } from "@mui/icons-material" ;
6
+ import {
7
+ ChevronRightRounded ,
8
+ ArrowBackRounded ,
9
+ ViewListOutlined ,
10
+ } from "@mui/icons-material" ;
6
11
7
12
// Define additional properties used by D3 during transitions
8
13
interface D3TransitionNode {
@@ -146,6 +151,17 @@ export const NodeDetails: React.FC<NodeDetailsProps> = ({
146
151
147
152
// Create the filter URL for this node if possible
148
153
const filterUrl = createFilterUrl ( nodeRank , nodeName ) ;
154
+ // Fallback URL to the main assemblies page
155
+ const linkUrl = filterUrl || "/data/assemblies" ;
156
+
157
+ // Create the appropriate display text based on node type
158
+ let filterLinkText = "Browse All Assemblies" ;
159
+ if ( ! isRoot ) {
160
+ const assemblyCount = countLeafNodes ( node ) ;
161
+ const assemblySuffix = assemblyCount > 1 ? "ies" : "y" ;
162
+ filterLinkText = `View ${ assemblyCount } Assembl${ assemblySuffix } for ${ nodeName } ` ;
163
+ }
164
+
149
165
150
166
return (
151
167
< div
@@ -158,29 +174,19 @@ export const NodeDetails: React.FC<NodeDetailsProps> = ({
158
174
>
159
175
< div style = { { flex : "1" , marginTop : "20px" } } >
160
176
< RoundedPaper >
161
- { /* View Assemblies Row - Always visible within the card */ }
162
- { ! isRoot && filterUrl ? (
163
- < div
164
- style = { {
165
- borderBottom : "1px solid #eee" ,
166
- padding : "12px 16px" ,
167
- } }
168
- >
169
- < a
170
- href = { filterUrl }
171
- rel = "noopener noreferrer"
172
- style = { {
173
- color : "#1976d2" ,
174
- display : "block" ,
175
- fontSize : "14px" ,
176
- textDecoration : "none" ,
177
- } }
178
- >
179
- View { countLeafNodes ( node ) } Assembl
180
- { countLeafNodes ( node ) > 1 ? "ies" : "y" } for { nodeName }
181
- </ a >
182
- </ div >
183
- ) : null }
177
+ < div
178
+ style = { {
179
+ alignItems : "center" ,
180
+ borderBottom : "1px solid #e0e0e0" ,
181
+ borderTopLeftRadius : "8px" ,
182
+ borderTopRightRadius : "8px" ,
183
+ display : "flex" ,
184
+ padding : "12px 16px" ,
185
+ } }
186
+ >
187
+ < ViewListOutlined style = { { marginRight : "8px" } } />
188
+ < DXLink label = { filterLinkText } url = { linkUrl } />
189
+ </ div >
184
190
185
191
< div
186
192
style = { {
0 commit comments