File tree 1 file changed +6
-9
lines changed
packages/ui/src/elements/Table/DefaultCell/fields/File
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 1
1
'use client'
2
- import type { DefaultCellComponentProps , TextFieldClient , UploadFieldClient } from 'payload'
2
+ import type { DefaultCellComponentProps , UploadFieldClient } from 'payload'
3
3
4
4
import React from 'react'
5
5
@@ -8,30 +8,27 @@ import './index.scss'
8
8
9
9
const baseClass = 'file'
10
10
11
- export interface FileCellProps
12
- extends DefaultCellComponentProps < TextFieldClient | UploadFieldClient > { }
11
+ export interface FileCellProps extends DefaultCellComponentProps < any , UploadFieldClient > { }
13
12
14
13
export const FileCell : React . FC < FileCellProps > = ( {
15
14
cellData : filename ,
16
- collectionConfig ,
15
+ customCellContext ,
17
16
rowData,
18
17
} ) => {
19
18
const { collectionSlug, uploadConfig } = customCellContext
20
- const src = rowData ?. thumbnailURL || rowData ?. url
21
19
22
20
return (
23
21
< div className = { baseClass } >
24
22
< Thumbnail
25
23
className = { `${ baseClass } __thumbnail` }
26
- collectionSlug = { collectionConfig ?. slug }
24
+ collectionSlug = { collectionSlug }
27
25
doc = { {
28
26
...rowData ,
29
27
filename,
30
28
} }
31
- fileSrc = { src }
32
- key = { src }
29
+ fileSrc = { rowData ?. thumbnailURL || rowData ?. url }
33
30
size = "small"
34
- uploadConfig = { collectionConfig ?. upload }
31
+ uploadConfig = { uploadConfig }
35
32
/>
36
33
< span className = { `${ baseClass } __filename` } > { String ( filename ) } </ span >
37
34
</ div >
You can’t perform that action at this time.
0 commit comments