@@ -14,10 +14,9 @@ import { Images24Icon } from '@oxide/design-system/icons/react'
14
14
15
15
import { getProjectSelector , useProjectSelector , useToast } from '~/hooks'
16
16
import { confirmDelete } from '~/stores/confirm-delete'
17
- import { DateCell } from '~/table/cells/DateCell'
18
17
import { makeLinkCell } from '~/table/cells/LinkCell'
19
- import { SizeCell } from '~/table/cells/SizeCell'
20
18
import { getActionsCol , type MenuAction } from '~/table/columns/action-col'
19
+ import { Columns } from '~/table/columns/common'
21
20
import { useQueryTable } from '~/table/QueryTable'
22
21
import { buttonStyle } from '~/ui/lib/Button'
23
22
import { EmptyMessage } from '~/ui/lib/EmptyMessage'
@@ -37,7 +36,7 @@ const EmptyState = () => (
37
36
/>
38
37
)
39
38
40
- const columnHelper = createColumnHelper < Image > ( )
39
+ const colHelper = createColumnHelper < Image > ( )
41
40
42
41
ImagesPage . loader = async ( { params } : LoaderFunctionArgs ) => {
43
42
const { project } = getProjectSelector ( params )
@@ -85,18 +84,12 @@ export function ImagesPage() {
85
84
86
85
const columns = useMemo ( ( ) => {
87
86
return [
88
- columnHelper . accessor ( 'name' , {
87
+ colHelper . accessor ( 'name' , {
89
88
cell : makeLinkCell ( ( image ) => pb . projectImageEdit ( { ...projectSelector , image } ) ) ,
90
89
} ) ,
91
- columnHelper . accessor ( 'description' , { } ) ,
92
- columnHelper . accessor ( 'size' , {
93
- header : 'size' ,
94
- cell : ( info ) => < SizeCell value = { info . getValue ( ) } /> ,
95
- } ) ,
96
- columnHelper . accessor ( 'timeCreated' , {
97
- header : 'created' ,
98
- cell : ( info ) => < DateCell value = { info . getValue ( ) } /> ,
99
- } ) ,
90
+ colHelper . accessor ( 'description' , Columns . description ) ,
91
+ colHelper . accessor ( 'size' , Columns . size ) ,
92
+ colHelper . accessor ( 'timeCreated' , Columns . timeCreated ) ,
100
93
getActionsCol ( makeActions ) ,
101
94
]
102
95
} , [ projectSelector , makeActions ] )
0 commit comments