Skip to content

UploadFieldCell

UploadFieldCell<TData>(props): string | number | bigint | boolean | Element | Iterable<ReactNode, any, any> | Promise<AwaitedReactNode> | null | undefined

Defined in: packages/react/src/fields/upload/Cell.tsx:47

Table cell rendering for upload field.

Reads row.original[fieldKey] which is either:

  • VexMediaDocument[] — populated media docs when the list query was run with depth: 1 (the normal case; find/search’s buildDepthPopulate auto-populates upload fields the same way it auto-populates relationship fields).
  • string[] — raw media-document ids, a fallback for a row that predates depth-populate (e.g. a stale cached entry carried over a soft navigation).

Shows:

  • Empty: ”—” placeholder.
  • Populated (array of docs, any length): FilePreview thumbnail + filename truncated with ellipsis, +N badge for 2+ items — read straight from the row, no query.
  • Unpopulated fallback (array of raw ids): a full-width skeleton while a single get query (fired only in this case) resolves the first id.

Matches the UploadCell design: inline-flex with FilePreview (26px) + filename + badge.

TData extends TDocument = TDocument

CellComponentProps<UploadField<string, BaseFieldMeta>, TData, CollectionConfig<{ }, { }, string, Record<string, AdminField>, ComponentHKT, boolean, boolean, string>>

Component props.

string | number | bigint | boolean | Element | Iterable<ReactNode, any, any> | Promise<AwaitedReactNode> | null | undefined

An em-dash placeholder when empty, a skeleton while an unpopulated fallback row’s referenced media document is fetching, or a thumbnail + filename (with a +N badge for additional items).