@@ -15,9 +15,8 @@ import {
1515 Icon ,
1616 Spinner ,
1717 Table ,
18- Text
18+ Text ,
1919} from 'opub-ui' ;
20- import { useEffect , useRef , useState } from 'react' ;
2120
2221import { Icons } from '@/components/icons' ;
2322import { GraphQL } from '@/lib/api' ;
@@ -66,8 +65,6 @@ const Resources = () => {
6665 )
6766 ) ;
6867
69-
70-
7168 const generateColumnData = ( ) => {
7269 return [
7370 {
@@ -77,7 +74,12 @@ const Resources = () => {
7774 return (
7875 < Dialog >
7976 < Dialog . Trigger >
80- < Button kind = "tertiary" className = ' text-secondaryOrange underline' > View All Columns</ Button >
77+ < Button
78+ kind = "tertiary"
79+ className = " text-secondaryOrange underline"
80+ >
81+ View All Columns
82+ </ Button >
8183 </ Dialog . Trigger >
8284 < Dialog . Content title = { 'All Columns' } limitHeight >
8385 < Table
@@ -152,7 +154,11 @@ const Resources = () => {
152154 return (
153155 < Dialog >
154156 < Dialog . Trigger >
155- < Button kind = "tertiary" disabled = { ! previewData } className = ' text-secondaryOrange underline' >
157+ < Button
158+ kind = "tertiary"
159+ disabled = { ! previewData }
160+ className = " text-secondaryOrange underline"
161+ >
156162 Preview
157163 </ Button >
158164 </ Dialog . Trigger >
@@ -179,10 +185,8 @@ const Resources = () => {
179185 } ,
180186 ] ;
181187 } ;
182- const [ isexpanded , setIsexpanded ] = useState ( false ) ;
183- const toggleDescription = ( ) => setIsexpanded ( ! isexpanded ) ;
184188 return (
185- < div >
189+ < div >
186190 { getResourceDetails . isLoading ? (
187191 < div className = "mt-8 flex justify-center" >
188192 < Spinner />
@@ -193,8 +197,7 @@ const Resources = () => {
193197 < div className = "flex flex-col gap-1" >
194198 < Text variant = "heading2xl" > Files in this Dataset </ Text >
195199 < Text variant = "headingLg" fontWeight = "regular" >
196- All files associated with this Dataset which can be
197- downloaded{ ' ' }
200+ All files associated with this Dataset which can be downloaded{ ' ' }
198201 </ Text >
199202 </ div >
200203 < div >
@@ -212,38 +215,6 @@ const Resources = () => {
212215 < Format fileType = { item . fileDetails ?. format } />
213216 ) }
214217 </ div >
215- < div className = "lg:w-3/4" >
216- < Text className = ' hidden lg:block' >
217- { item . description . length > 260 && ! isexpanded
218- ? `${ item . description . slice ( 0 , 260 ) } ...`
219- : item . description }
220- { item . description . length > 260 && (
221- < Button
222- kind = "tertiary"
223- size = "slim"
224- onClick = { toggleDescription }
225- className = "text-blue-600 w-fit"
226- >
227- { isexpanded ? 'See Less' : 'See More' }
228- </ Button >
229- ) }
230- </ Text >
231- < Text className = ' lg:hidden block' >
232- { item . description . length > 160 && ! isexpanded
233- ? `${ item . description . slice ( 0 , 160 ) } ...`
234- : item . description }
235- { item . description . length > 160 && (
236- < Button
237- kind = "tertiary"
238- size = "slim"
239- onClick = { toggleDescription }
240- className = "text-blue-600 w-fit"
241- >
242- { isexpanded ? 'See Less' : 'See More' }
243- </ Button >
244- ) }
245- </ Text >
246- </ div >
247218 </ div >
248219 </ div >
249220 < Accordion type = "single" collapsible className = "w-full" >
@@ -267,10 +238,7 @@ const Resources = () => {
267238 { ' ' }
268239 Download
269240 </ Text >
270- < Icon
271- source = { Icons . download }
272- size = { 20 }
273- />
241+ < Icon source = { Icons . download } size = { 20 } />
274242 </ div >
275243 </ Button >
276244 </ Link >
@@ -287,7 +255,6 @@ const Resources = () => {
287255 columns = { generateColumnData ( ) }
288256 rows = { generateTableData ( item ) }
289257 hideFooter
290-
291258 />
292259 </ AccordionContent >
293260 </ AccordionItem >
0 commit comments