@@ -6,10 +6,6 @@ import PdfPreview from '@/app/[locale]/(user)/components/PdfPreview';
66import { graphql } from '@/gql' ;
77import { useQuery } from '@tanstack/react-query' ;
88import {
9- Accordion ,
10- AccordionContent ,
11- AccordionItem ,
12- AccordionTrigger ,
139 Button ,
1410 Dialog ,
1511 Format ,
@@ -21,7 +17,7 @@ import {
2117
2218import { GraphQL } from '@/lib/api' ;
2319import { Icons } from '@/components/icons' ;
24-
20+ import styles from './Resources.module.scss' ;
2521const datasetResourceQuery : any = graphql ( `
2622 query datasetResources($datasetId: UUID!) {
2723 datasetResources(datasetId: $datasetId) {
@@ -82,7 +78,7 @@ const Resources = () => {
8278 View All Columns
8379 </ Button >
8480 </ Dialog . Trigger >
85- < Dialog . Content title = { 'All Columns' } limitHeight >
81+ < Dialog . Content title = { 'All Columns' } limitHeight className = { styles . dialogTableWrapper } >
8682 < Table
8783 columns = { [
8884 {
@@ -168,7 +164,7 @@ const Resources = () => {
168164 Preview
169165 </ Button >
170166 </ Dialog . Trigger >
171- < Dialog . Content title = { 'Preview' } limitHeight large >
167+ < Dialog . Content title = { 'Preview' } limitHeight large className = { styles . dialogTableWrapper } >
172168 { row . original . format === 'PDF' ? (
173169 < PdfPreview
174170 url = { `${ process . env . NEXT_PUBLIC_BACKEND_URL } /api/download/resource/${ row . original . id } ` }
@@ -225,63 +221,49 @@ const Resources = () => {
225221 className = "mt-5 flex flex-col gap-6 border-1 border-solid border-greyExtralight bg-surfaceDefault p-4 lg:mx-0 lg:p-6"
226222 >
227223 < div >
228- < Accordion type = "single" collapsible className = "w-full" >
229- < AccordionItem value = "item-1" className = " border-none" >
230- < div className = "flex flex-wrap md:flex-nowrap items-center justify-between gap-4" >
231- < div className = "flex flex-wrap md:flex-nowrap items-center gap-2 " >
232- { item . fileDetails ?. format && (
233- < Format fileType = { item . fileDetails ?. format } />
234- ) }
235- < Text variant = "headingMd" className = " line-clamp-1" >
236- { item . name }
237- </ Text >
238- </ div >
239- < div className = "flex items-center gap-4" >
240- < AccordionTrigger className = "flex w-full items-center gap-2 p-0 hover:no-underline" >
224+ < div className = "flex flex-wrap md:flex-nowrap items-center justify-between gap-4" >
225+ < div className = "flex flex-wrap md:flex-nowrap items-center gap-2 " >
226+ { item . fileDetails ?. format && (
227+ < Format fileType = { item . fileDetails ?. format } />
228+ ) }
229+ < Text variant = "headingMd" className = " line-clamp-1" >
230+ { item . name }
231+ </ Text >
232+ </ div >
233+ < div className = "flex items-center gap-4" >
234+ < Link
235+ href = { `${ process . env . NEXT_PUBLIC_BACKEND_URL } /api/download/resource/${ item . id } ` }
236+ target = "_blank"
237+ className = "flex justify-center"
238+ >
239+ < Button kind = "tertiary" >
240+ < div className = "flex gap-1" >
241241 < Text
242242 variant = "bodyLg"
243- className = " w-[100px] text-secondaryText"
243+ className = " text-primaryText"
244+ fontWeight = "semibold"
244245 >
245- { ' ' }
246- View Details
246+ Download
247247 </ Text >
248- </ AccordionTrigger >
249- < Link
250- href = { `${ process . env . NEXT_PUBLIC_BACKEND_URL } /api/download/resource/${ item . id } ` }
251- target = "_blank"
252- className = "flex justify-center"
253- >
254- < Button kind = "tertiary" >
255- < div className = "flex gap-1" >
256- < Text
257- variant = "bodyLg"
258- className = " text-primaryText"
259- fontWeight = "semibold"
260- >
261- { ' ' }
262- Download
263- </ Text >
264- < Icon source = { Icons . download } size = { 20 } />
265- </ div >
266- </ Button >
267- </ Link >
248+ < Icon source = { Icons . download } size = { 20 } />
268249 </ div >
269- </ div >
270- < AccordionContent
271- className = "flex w-full flex-col py-5"
272- style = { {
273- backgroundColor : 'var( --base-pure-white)' ,
274- outline : '1px solid var( --base-pure-white)' ,
275- } }
276- >
277- < Table
278- columns = { generateColumnData ( ) }
279- rows = { generateTableData ( item ) }
280- hideFooter
281- />
282- </ AccordionContent >
283- </ AccordionItem >
284- </ Accordion >
250+ </ Button >
251+ </ Link >
252+ </ div >
253+ </ div >
254+ < div
255+ className = { `flex w-full flex-col py-5 ${ styles . tableWrapper } ` }
256+ style = { {
257+ backgroundColor : 'var( --base-pure-white)' ,
258+ outline : '1px solid var( --base-pure-white)' ,
259+ } }
260+ >
261+ < Table
262+ columns = { generateColumnData ( ) }
263+ rows = { generateTableData ( item ) }
264+ hideFooter
265+ />
266+ </ div >
285267 </ div >
286268 </ div >
287269 )
0 commit comments