Newer
Older
navi-1 / webclient / src / utils / artifactContent.js
import { contentTypeFromName, normalizeContentType } from '@/utils/contentTypes.js'

/** The one content-type decision for an artifact or a session file entry. */
export function itemContentType(item) {
  return normalizeContentType(item?.content_type)
    || contentTypeFromName(item?.filename || item?.path || item?.url || '')
}