@@ -16,6 +16,36 @@ import { ExpandableTableWrapper } from "./ExpandableTableWrapper.tsx"
1616
1717const feedItems = monitoredFeeds . mainnet
1818
19+ // Helper function to parse markdown links and render them
20+ const parseMarkdownLink = ( text : string ) => {
21+ // Match markdown link format: [text](url)
22+ const markdownLinkRegex = / \[ ( [ ^ \] ] + ) \] \( ( [ ^ ) ] + ) \) / g
23+ const parts : any [ ] = [ ]
24+ let lastIndex = 0
25+ let match
26+
27+ while ( ( match = markdownLinkRegex . exec ( text ) ) !== null ) {
28+ // Add text before the link
29+ if ( match . index > lastIndex ) {
30+ parts . push ( text . substring ( lastIndex , match . index ) )
31+ }
32+ // Add the link
33+ parts . push (
34+ < a href = { match [ 2 ] } target = "_blank" rel = "noopener noreferrer" key = { match . index } >
35+ { match [ 1 ] }
36+ </ a >
37+ )
38+ lastIndex = match . index + match [ 0 ] . length
39+ }
40+
41+ // Add remaining text after the last link
42+ if ( lastIndex < text . length ) {
43+ parts . push ( text . substring ( lastIndex ) )
44+ }
45+
46+ return parts . length > 0 ? parts : text
47+ }
48+
1949// Render a category icon/link from the config
2050const getFeedCategoryElement = ( riskTier : string | undefined ) => {
2151 if ( ! riskTier ) return ""
@@ -421,13 +451,18 @@ const SmartDataTr = ({ network, metadata, showExtraDetails, batchedCategoryData
421451 { metadata . docs . shutdownDate }
422452 </ div >
423453 ) }
424- { metadata . docs . productType && (
425- < div >
426- < dd style = { { marginTop : "5px" } } > { metadata . docs . productType } </ dd >
454+ { ( metadata . docs . assetClass === "Stablecoin Stability Assessment" ||
455+ ( metadata . docs . productType && metadata . docs . assetClass !== "Stablecoin Stability Assessment" ) ) && (
456+ < div style = { { marginTop : "5px" , textAlign : "center" } } >
457+ < dd >
458+ { metadata . docs . assetClass === "Stablecoin Stability Assessment"
459+ ? metadata . docs . assetClass
460+ : metadata . docs . productType }
461+ </ dd >
427462 </ div >
428463 ) }
429464 { finalIsMVRFeed && (
430- < div style = { { marginTop : "5px" } } >
465+ < div style = { { marginTop : "5px" , textAlign : "center" } } >
431466 < a
432467 href = "/data-feeds/mvr-feeds"
433468 className = { tableStyles . feedVariantBadge }
@@ -478,11 +513,21 @@ const SmartDataTr = ({ network, metadata, showExtraDetails, batchedCategoryData
478513 < dl className = { tableStyles . listContainer } >
479514 < div className = { tableStyles . definitionGroup } >
480515 < dt >
481- < span className = "label" > Asset name:</ span >
516+ < span className = "label" >
517+ { metadata . docs . assetClass === "Stablecoin Stability Assessment"
518+ ? "Stablecoin assessed:"
519+ : "Asset name:" }
520+ </ span >
482521 </ dt >
483- < dd > { metadata . assetName } </ dd >
522+ < dd >
523+ { /* For Stablecoin Stability Assessment feeds, valueSuffix contains the stablecoin ticker being assessed*/ }
524+ { metadata . docs . assetClass === "Stablecoin Stability Assessment"
525+ ? metadata . valueSuffix || metadata . assetName
526+ : metadata . assetName }
527+ </ dd >
484528 </ div >
485- { metadata . docs . porType && (
529+ { /* Hide Reserve type for Stablecoin Stability Assessment feeds */ }
530+ { metadata . docs . porType && metadata . docs . assetClass !== "Stablecoin Stability Assessment" && (
486531 < div className = { tableStyles . definitionGroup } >
487532 < dt >
488533 < span className = "label" > Reserve type:</ span >
@@ -505,7 +550,7 @@ const SmartDataTr = ({ network, metadata, showExtraDetails, batchedCategoryData
505550 { metadata . docs . porSource === "Third-party" ? "Auditor verification:" : "Reporting:" }
506551 </ span >
507552 </ dt >
508- < dd > { metadata . docs . porSource } </ dd >
553+ < dd > { parseMarkdownLink ( metadata . docs . porSource ) } </ dd >
509554 </ div >
510555 ) }
511556 { metadata . docs . issuer ? (
@@ -1153,7 +1198,8 @@ export const MainnetTable = ({
11531198
11541199 const included =
11551200 selectedFeedCategories . length === 0 ||
1156- ( metadata . docs . productType && selectedFeedCategories . includes ( metadata . docs . productType ) )
1201+ ( metadata . docs . productType && selectedFeedCategories . includes ( metadata . docs . productType ) ) ||
1202+ ( metadata . docs . assetClass && selectedFeedCategories . includes ( metadata . docs . assetClass ) )
11571203
11581204 return included
11591205 }
@@ -1412,7 +1458,8 @@ export const TestnetTable = ({
14121458
14131459 const included =
14141460 selectedFeedCategories . length === 0 ||
1415- ( metadata . docs . productType && selectedFeedCategories . includes ( metadata . docs . productType ) )
1461+ ( metadata . docs . productType && selectedFeedCategories . includes ( metadata . docs . productType ) ) ||
1462+ ( metadata . docs . assetClass && selectedFeedCategories . includes ( metadata . docs . assetClass ) )
14161463
14171464 return included
14181465 }
0 commit comments