@@ -12,6 +12,7 @@ import { StreamsNetworksData, type NetworkData } from "../data/StreamsNetworksDa
1212import { FEED_CATEGORY_CONFIG } from "../../../db/feedCategories.js"
1313import { useBatchedFeedCategories , getFeedCategoryFromBatch , getNetworkIdentifier } from "./useBatchedFeedCategories.ts"
1414import { isSharedSVR , isAaveSVR } from "~/features/feeds/utils/svrDetection.ts"
15+ import { ExpandableTableWrapper } from "./ExpandableTableWrapper.tsx"
1516
1617const feedItems = monitoredFeeds . mainnet
1718
@@ -589,7 +590,6 @@ export const StreamsNetworkAddressesTable = ({
589590 defaultExpanded ?: boolean
590591} = { } ) => {
591592 const [ searchValue , setSearchValue ] = useState ( "" )
592- const [ isExpanded , setIsExpanded ] = useState ( defaultExpanded )
593593
594594 const normalizedSearch = searchValue . toLowerCase ( ) . replaceAll ( " " , "" )
595595
@@ -609,53 +609,26 @@ export const StreamsNetworkAddressesTable = ({
609609 return networkMatch || match ( mainnetLabel ) || match ( testnetLabel ) || match ( mainnetAddr ) || match ( testnetAddr )
610610 } )
611611
612- return (
613- < div className = { tableStyles . compactNetworksTable } >
614- { allowExpansion && (
615- < div
616- className = { tableStyles . expandableHeader }
617- onClick = { ( ) => setIsExpanded ( ! isExpanded ) }
618- role = "button"
619- tabIndex = { 0 }
620- onKeyDown = { ( e ) => {
621- if ( e . key === "Enter" || e . key === " " ) {
622- e . preventDefault ( )
623- setIsExpanded ( ! isExpanded )
624- }
625- } }
626- >
627- < div className = { tableStyles . expandableHeaderContent } >
628- < h2 > Streams Verifier Network Addresses</ h2 >
629- { ! isExpanded && (
630- < p className = { tableStyles . expandableDescription } >
631- < em > Expand to view verifier proxy addresses required for onchain report verification</ em >
632- </ p >
633- ) }
634- </ div >
635- < div className = { clsx ( tableStyles . expandableArrow , isExpanded && tableStyles . expandableArrowExpanded ) } />
612+ const tableContent = (
613+ < >
614+ < div className = { feedList . filterDropdown_search } style = { { padding : "0.5rem" } } >
615+ < div style = { { display : "flex" , alignItems : "center" , gap : "0.5rem" , flex : 1 } } >
616+ < input
617+ type = "text"
618+ placeholder = "Search"
619+ className = { feedList . filterDropdown_searchInput }
620+ value = { searchValue }
621+ onInput = { ( e ) => setSearchValue ( ( e . target as HTMLInputElement ) . value ) }
622+ />
623+ { searchValue && (
624+ < button className = { clsx ( button . secondary , feedList . clearFilterBtn ) } onClick = { ( ) => setSearchValue ( "" ) } >
625+ Clear filter
626+ </ button >
627+ ) }
636628 </ div >
637- ) }
638-
639- { ( ! allowExpansion || isExpanded ) && (
640- < div className = { tableStyles . tableContainer } >
641- < div className = { feedList . filterDropdown_search } style = { { padding : "0.5rem" } } >
642- < div style = { { display : "flex" , alignItems : "center" , gap : "0.5rem" , flex : 1 } } >
643- < input
644- type = "text"
645- placeholder = "Search"
646- className = { feedList . filterDropdown_searchInput }
647- value = { searchValue }
648- onInput = { ( e ) => setSearchValue ( ( e . target as HTMLInputElement ) . value ) }
649- />
650- { searchValue && (
651- < button className = { clsx ( button . secondary , feedList . clearFilterBtn ) } onClick = { ( ) => setSearchValue ( "" ) } >
652- Clear filter
653- </ button >
654- ) }
655- </ div >
656- </ div >
629+ </ div >
657630
658- < table className = { tableStyles . networksTable } >
631+ < table className = { tableStyles . networksTable } >
659632 < thead >
660633 < tr >
661634 < th className = { tableStyles . networkColumn } > Network</ th >
@@ -796,8 +769,19 @@ export const StreamsNetworkAddressesTable = ({
796769 } ) }
797770 </ tbody >
798771 </ table >
799- </ div >
800- ) }
772+ </ >
773+ )
774+
775+ return (
776+ < div className = { tableStyles . compactNetworksTable } >
777+ < ExpandableTableWrapper
778+ title = "Streams Verifier Network Addresses"
779+ description = "Expand to view verifier proxy addresses required for onchain report verification"
780+ allowExpansion = { allowExpansion }
781+ defaultExpanded = { defaultExpanded }
782+ >
783+ { tableContent }
784+ </ ExpandableTableWrapper >
801785 </ div >
802786 )
803787}
0 commit comments