11/** @jsxImportSource preact */
22import { useEffect , useState , useRef , useMemo } from "preact/hooks"
3- import { MainnetTable , TestnetTable , StreamsNetworkAddressesTable } from "./Tables.tsx"
3+ import { MainnetTable , TestnetTable , StreamsNetworkAddressesTable , StreamsTHead , StreamsTr } from "./Tables.tsx"
44import feedList from "./FeedList.module.css"
55import tableStyles from "./Tables.module.css"
66import { clsx } from "~/lib/clsx/clsx.ts"
@@ -744,6 +744,54 @@ export const FeedList = ({
744744 dataFeedType === "streamsExRate" ||
745745 dataFeedType === "streamsBacked"
746746 ) {
747+ // For deprecating streams, show a consolidated table across all networks
748+ if ( isDeprecating ) {
749+ const allDeprecatingStreams : any [ ] = [ ]
750+
751+ // Check both chainMetadata and initialCache for deprecating streams
752+ const networksToCheck =
753+ chainMetadata . processedData ?. networks ||
754+ ( initialCache && initialCache . deprecated ? ( initialCache . deprecated as any ) . networks : [ ] )
755+
756+ networksToCheck . forEach ( ( network : any ) => {
757+ network . metadata ?. forEach ( ( item : any ) => {
758+ // Only include items that are actual streams (have verifier contract type and feedId)
759+ // and have a shutdown date
760+ if ( item . contractType === "verifier" && item . feedId && item . docs ?. shutdownDate ) {
761+ allDeprecatingStreams . push ( {
762+ ...item ,
763+ networkName : network . name ,
764+ } )
765+ }
766+ } )
767+ } )
768+
769+ return (
770+ < >
771+ { chainMetadata . loading && ! chainMetadata . processedData && ! initialCache && < p > Loading...</ p > }
772+ { chainMetadata . error && < p > There was an error loading the streams...</ p > }
773+
774+ { allDeprecatingStreams . length > 0 ? (
775+ < SectionWrapper title = "Deprecating Streams" depth = { 2 } >
776+ < div className = { feedList . tableWrapper } >
777+ < table className = { clsx ( tableStyles . table ) } >
778+ < StreamsTHead />
779+ < tbody >
780+ { allDeprecatingStreams . map ( ( stream , index ) => (
781+ < StreamsTr key = { `${ stream . feedId } -${ index } ` } metadata = { stream } isMainnet = { true } />
782+ ) ) }
783+ </ tbody >
784+ </ table >
785+ </ div >
786+ </ SectionWrapper >
787+ ) : (
788+ ! chainMetadata . loading && < p > No deprecating streams found at this time.</ p >
789+ ) }
790+ </ >
791+ )
792+ }
793+
794+ // Regular streams view (non-deprecating)
747795 const mainnetFeeds : ChainNetwork [ ] = [ ]
748796 const testnetFeeds : ChainNetwork [ ] = [ ]
749797
@@ -759,20 +807,24 @@ export const FeedList = ({
759807
760808 return (
761809 < >
762- { allowNetworkTableExpansion ? (
763- < div style = { { marginBottom : "var(--space-2x)" } } >
764- < StreamsNetworkAddressesTable
765- allowExpansion = { allowNetworkTableExpansion }
766- defaultExpanded = { defaultNetworkTableExpanded }
767- />
768- </ div >
769- ) : (
770- < SectionWrapper title = "Streams Verifier Network Addresses" depth = { 2 } >
771- < StreamsNetworkAddressesTable
772- allowExpansion = { allowNetworkTableExpansion }
773- defaultExpanded = { defaultNetworkTableExpanded }
774- />
775- </ SectionWrapper >
810+ { ! isDeprecating && (
811+ < >
812+ { allowNetworkTableExpansion ? (
813+ < div style = { { marginBottom : "var(--space-2x)" } } >
814+ < StreamsNetworkAddressesTable
815+ allowExpansion = { allowNetworkTableExpansion }
816+ defaultExpanded = { defaultNetworkTableExpanded }
817+ />
818+ </ div >
819+ ) : (
820+ < SectionWrapper title = "Streams Verifier Network Addresses" depth = { 2 } >
821+ < StreamsNetworkAddressesTable
822+ allowExpansion = { allowNetworkTableExpansion }
823+ defaultExpanded = { defaultNetworkTableExpanded }
824+ />
825+ </ SectionWrapper >
826+ ) }
827+ </ >
776828 ) }
777829
778830 < SectionWrapper
@@ -1057,7 +1109,8 @@ export const FeedList = ({
10571109 . filter ( ( network : any ) => {
10581110 let foundDeprecated = false
10591111 network . metadata ?. forEach ( ( feed : any ) => {
1060- if ( feed . feedCategory === "deprecating" ) {
1112+ // Only include actual feeds (not streams) with deprecating status
1113+ if ( feed . feedCategory === "deprecating" && ! ( feed . contractType === "verifier" && feed . feedId ) ) {
10611114 foundDeprecated = true
10621115 }
10631116 } )
@@ -1083,7 +1136,10 @@ export const FeedList = ({
10831136 }
10841137 network = { {
10851138 ...network ,
1086- metadata : network . metadata . filter ( ( feed : any ) => feed . feedCategory === "deprecating" ) ,
1139+ metadata : network . metadata . filter (
1140+ ( feed : any ) =>
1141+ feed . feedCategory === "deprecating" && ! ( feed . contractType === "verifier" && feed . feedId )
1142+ ) ,
10871143 } }
10881144 showExtraDetails = { showExtraDetails }
10891145 showOnlySVR = { showOnlySVR }
@@ -1108,7 +1164,8 @@ export const FeedList = ({
11081164 if ( isDeprecating ) {
11091165 let foundDeprecated = false
11101166 network . metadata ?. forEach ( ( feed : any ) => {
1111- if ( feed . feedCategory === "deprecating" ) {
1167+ // Only include actual feeds (not streams) with deprecating status
1168+ if ( feed . feedCategory === "deprecating" && ! ( feed . contractType === "verifier" && feed . feedId ) ) {
11121169 foundDeprecated = true
11131170 }
11141171 } )
0 commit comments