22
33import { useMemo , useState } from 'react'
44import { Chip , ChipInput , ChipModalTabs } from '@sim/emcn'
5- import { Folder , Search , Workflow } from '@sim/emcn/icons'
5+ import { Search } from '@sim/emcn/icons'
66import { toError } from '@sim/utils/errors'
77import { formatDate } from '@sim/utils/formatting'
88import { useParams , useRouter } from 'next/navigation'
@@ -72,12 +72,12 @@ const SORT_OPTIONS: ColumnOption[] = [
7272 { id : 'type' , label : 'Type' } ,
7373]
7474
75- const ICON_CLASS = 'size-5'
75+ const ICON_CLASS = 'size-5 shrink-0 '
7676
77- const RESOURCE_TYPE_TO_MOTHERSHIP : Partial <
78- Record < Exclude < ResourceType , 'all' > , MothershipResourceType >
79- > = {
77+ const RESOURCE_TYPE_TO_MOTHERSHIP : Record < Exclude < ResourceType , 'all' > , MothershipResourceType > = {
8078 workflow : 'workflow' ,
79+ folder : 'folder' ,
80+ workspace_folder : 'filefolder' ,
8181 table : 'table' ,
8282 knowledge : 'knowledgebase' ,
8383 file : 'file' ,
@@ -89,7 +89,6 @@ interface DeletedResource {
8989 type : Exclude < ResourceType , 'all' >
9090 deletedAt : Date
9191 workspaceId : string
92- color ?: string
9392}
9493
9594interface RestoredResourceEntry {
@@ -116,17 +115,7 @@ const TYPE_LABEL: Record<Exclude<ResourceType, 'all'>, string> = {
116115}
117116
118117function ResourceIcon ( { resource } : { resource : DeletedResource } ) {
119- if ( resource . type === 'workflow' ) {
120- return < Workflow className = { `${ ICON_CLASS } shrink-0 text-[var(--text-icon)]` } />
121- }
122-
123- if ( resource . type === 'folder' || resource . type === 'workspace_folder' ) {
124- const color = resource . color ?? '#6B7280'
125- return < Folder className = { ICON_CLASS } style = { { color } } />
126- }
127-
128118 const mothershipType = RESOURCE_TYPE_TO_MOTHERSHIP [ resource . type ]
129- if ( ! mothershipType ) return null
130119 const config = RESOURCE_REGISTRY [ mothershipType ]
131120 return config . renderTabIcon (
132121 { type : mothershipType , id : resource . id , title : resource . name } ,
@@ -222,7 +211,6 @@ export function RecentlyDeleted() {
222211 type : 'folder' ,
223212 deletedAt : folder . archivedAt ? new Date ( folder . archivedAt ) : new Date ( folder . updatedAt ) ,
224213 workspaceId : folder . workspaceId ,
225- color : folder . color ,
226214 } )
227215 }
228216
0 commit comments