UNPKG

@mikezimm/fps-core-v7

Version:

Library of reusable core interfaces, types and constants migrated from fps-library-v2

119 lines (118 loc) 3.74 kB
/** * CodeAnalizerComment: Updated 1 imports on 2024-09-21 23:07:24 * Update:: import { IFPSFileObject } to '@mikezimm/fps-core-v7/lib/components/molecules/AnyContent/IFPSFileObject;' */ export function getFileTypeIconInfoFromItem(item) { const thisContentType = item[`ContentType/Name`] ? item[`ContentType/Name`] : 'Unknown'; if (!item.DocIcon && thisContentType.indexOf(`Document Set`) > -1) { item.DocIcon = 'docset'; } else if (item.FileSystemObjectType === 1) return { iconName: 'OpenFolderHorizontal', iconColor: 'black', iconTitle: 'Folder', iconSearch: 'Type:Folder', }; const iconInfo = item.DocIcon ? getFileTypeIconInfo(item.DocIcon) : { iconName: 'TagUnknown', iconColor: 'black', iconTitle: 'Folder', iconSearch: 'Type:Unknown', }; return iconInfo; } /** * 2023-03-19: NOTE... I Added missing types into MediaFileKeys & MediaFileSearchTypes * Maybe someday standardize using SearchTypes and SourcePages */ export function getFileTypeIconInfo(ext) { let iconColor = 'black'; let iconName = ext; let iconTitle = ext; let iconSearch = ext; switch (ext) { case 'xls': case 'xlsm': case 'xlsb': case 'xlsx': iconColor = 'darkgreen'; iconName = 'ExcelDocument'; iconSearch = 'Type:Excel'; break; case 'doc': case 'docx': iconColor = 'darkblue'; iconName = 'WordDocument'; iconSearch = 'Type:Word'; break; case 'ppt': case 'pptx': case 'pptm': iconColor = 'firebrick'; iconName = 'PowerPointDocument'; iconSearch = 'Type:PowerPoint'; break; case 'pdf': iconColor = 'red'; iconSearch = 'Type:pdf'; break; case 'one': case 'onepkg': iconColor = 'purple'; iconName = 'OneNoteLogo'; iconSearch = 'Type:OneNote'; break; case 'msg': iconColor = 'blue'; iconName = 'OutlookLogo'; iconSearch = 'Type:Outlook'; break; case '7z': case 'zip': iconColor = 'blue'; iconName = 'ZipFolder'; iconSearch = 'Type:Zipped'; break; case 'avi': case 'mp4': case 'wmf': case 'mov': case 'wmv': iconColor = 'blue'; iconName = 'MSNVideosSolid'; iconSearch = 'Type:Movie'; break; // case 'msg': // iconColor = 'blue'; // iconName = 'Microphone'; // break; case 'png': case 'gif': case 'jpg': case 'jpeg': iconColor = 'blue'; iconName = 'Photo2'; iconSearch = 'Type:Image'; break; case 'txt': case 'csv': iconName = 'TextDocument'; iconSearch = 'Type:Text'; break; case 'dwg': iconName = 'PenWorkspace'; iconSearch = 'Type:Dwg'; break; case 'docset': iconColor = 'black'; iconName = 'DocumentSet'; iconSearch = 'Type:DocumentSet'; default: iconName = 'FileTemplate'; iconSearch = 'Type:File'; break; } return { iconName: iconName, iconColor: iconColor, iconTitle: iconTitle, iconSearch: iconSearch }; } //# sourceMappingURL=stdECStorage.js.map