refactor: use new documents interfaces

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-07-09 19:36:16 -04:00
parent dfdeb30a8b
commit 70903d48a8
14 changed files with 146 additions and 425 deletions
+11 -1
View File
@@ -3,17 +3,20 @@ import { computed } from 'vue'
import { CollectionObject } from '@DocumentsManager/models/collection'
import { EntityObject } from '@DocumentsManager/models/entity'
import { getFileIcon, formatSize, formatDate } from '@/utils/fileHelpers'
import { FileActionsMenu } from '@/components'
import { FileActionsMenu, FilePreviewPopover } from '@/components'
type ItemWithType = {
item: CollectionObject | EntityObject
type: 'collection' | 'entity'
}
type PreviewSource = (item: { id: string; meta?: Record<string, unknown> }) => string | Blob | Promise<string | Blob>
const props = defineProps<{
collections: CollectionObject[]
entities: EntityObject[]
selectedIds: Set<string>
previewSource?: PreviewSource
}>()
const emit = defineEmits<{
@@ -105,6 +108,13 @@ function isCollection(wrapped: ItemWithType): wrapped is { item: CollectionObjec
@show-details="emit('show-details', $event)"
/>
</div>
<FilePreviewPopover
v-if="previewSource"
:entity="(wrapped.item as EntityObject)"
:source="previewSource"
@expand="emit('open', $event)"
/>
</div>
</template>
</v-virtual-scroll>