@@ -31,7 +31,7 @@ export function StratPage({ show }) {
3131 const prevInputRef = useRef ( input ) ;
3232 const prevShowConceptsRef = useRef ( showConcepts ) ;
3333 const prevShowNamesRef = useRef ( showNames ) ;
34- console . log ( "lastID" , lastID ) ;
34+ console . log ( "lastID" , lastID ) ;
3535
3636 useEffect ( ( ) => {
3737 if (
@@ -52,9 +52,7 @@ export function StratPage({ show }) {
5252 if (
5353 result &&
5454 data [ data . length - 1 ] ?. [ showConcepts ? "concept_id" : "id" ] !==
55- result [ result . length - 1 ] ?. [
56- showConcepts ? "concept_id" : "id"
57- ]
55+ result [ result . length - 1 ] ?. [ showConcepts ? "concept_id" : "id" ]
5856 ) {
5957 setData ( ( prevData ) => {
6058 return [ ...prevData , ...result ] ;
@@ -70,14 +68,25 @@ export function StratPage({ show }) {
7068
7169 return h ( ContentPage , [
7270 h ( StickyHeader , { className : "header" } , [
73- h ( PageBreadcrumbs , { title : showNames && showConcepts ? "Strat Names & Concepts" : showNames ? "Strat Names" : "Strat Concepts" } ) ,
71+ h ( PageBreadcrumbs , {
72+ title :
73+ showNames && showConcepts
74+ ? "Strat Names & Concepts"
75+ : showNames
76+ ? "Strat Names"
77+ : "Strat Concepts" ,
78+ } ) ,
7479 h ( "div.header-description" , [
75- h ( 'div.card-container' , [
76- h ( 'div' , { className : "status " + ( showNames ? "active" : "inactive" ) } ) ,
80+ h ( "div.card-container" , [
81+ h ( "div" , {
82+ className : "status " + ( showNames ? "active" : "inactive" ) ,
83+ } ) ,
7784 h (
7885 Card ,
7986 {
80- className : "strat-name-card " + ( ! showNames || showConcepts ? "clickable" : "" ) ,
87+ className :
88+ "strat-name-card " +
89+ ( ! showNames || showConcepts ? "clickable" : "" ) ,
8190 onClick : ( ) => {
8291 if ( ! showNames || showConcepts ) {
8392 setShowNames ( ! showNames ) ;
@@ -92,12 +101,16 @@ export function StratPage({ show }) {
92101 ]
93102 ) ,
94103 ] ) ,
95- h ( 'div.card-container' , [
96- h ( 'div' , { className : "status " + ( showConcepts ? "active" : "inactive" ) } ) ,
104+ h ( "div.card-container" , [
105+ h ( "div" , {
106+ className : "status " + ( showConcepts ? "active" : "inactive" ) ,
107+ } ) ,
97108 h (
98109 Card ,
99110 {
100- className : "strat-concept-card " + ( showNames || ! showConcepts ? "clickable" : "" ) ,
111+ className :
112+ "strat-concept-card " +
113+ ( showNames || ! showConcepts ? "clickable" : "" ) ,
101114 onClick : ( ) => {
102115 if ( showNames || ! showConcepts ) {
103116 setShowConcepts ( ! showConcepts ) ;
@@ -138,7 +151,12 @@ function StratItem({ data }) {
138151
139152 return h (
140153 LinkCard ,
141- { href : `/lex/${ isConcept ? "strat-name-concepts/" + concept_id : "strat-names/" + id } ` , className : isConcept ? "strat-concept-card" : "strat-name-card" } ,
154+ {
155+ href : `/lex/${
156+ isConcept ? "strat-name-concepts/" + concept_id : "strat-names/" + id
157+ } `,
158+ className : isConcept ? "strat-concept-card" : "strat-name-card" ,
159+ } ,
142160 isConcept ? ConceptBody ( { data } ) : StratBody ( { data } )
143161 ) ;
144162}
@@ -148,7 +166,14 @@ function StratBody({ data }) {
148166
149167 return h ( "div.strat-body" , [
150168 h ( "strong" , name ) ,
151- h . if ( concept_id ) ( Link , { className : "concept-tag" , href : `/lex/strat-name-concepts/${ concept_id } ` } , concept_name ) ,
169+ h . if ( concept_id ) (
170+ Link ,
171+ {
172+ className : "concept-tag" ,
173+ href : `/lex/strat-name-concepts/${ concept_id } ` ,
174+ } ,
175+ concept_name
176+ ) ,
152177 ] ) ;
153178}
154179
@@ -176,14 +201,21 @@ function useStratData(lastID, input, pageSize, showBoth, showNames) {
176201 const url1 = `${ apiDomain } /api/pg/strat_names_test?limit=${ pageSize } &id=gt.${ lastID } &order=id.asc&name=ilike.*${ input } *` ;
177202 const url2 = `${ apiDomain } /api/pg/strat_concepts_test?limit=${ pageSize } &concept_id=gt.${ lastID } &order=concept_id.asc&name=ilike.*${ input } *` ;
178203 const url3 = `${ apiDomain } /api/pg/strat_combined_test?limit=${ pageSize } &combined_id=gt.${ lastID } &order=combined_id.asc&name=ilike.*${ input } *` ;
179- const url = showBoth ? url3 : showNames ? url1 : url2 ;
204+ const url = showBoth ? url3 : showNames ? url1 : url2 ;
180205
181206 const result = useAPIResult ( url ) ;
182207
183208 return result ;
184209}
185210
186- function LoadMoreTrigger ( { data, setLastID, pageSize, result, showBoth, showNames } ) {
211+ function LoadMoreTrigger ( {
212+ data,
213+ setLastID,
214+ pageSize,
215+ result,
216+ showBoth,
217+ showNames,
218+ } ) {
187219 const ref = useRef ( null ) ;
188220
189221 useEffect ( ( ) => {
0 commit comments