mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 03:10:15 +01:00
* feat(sharepoint): integrate SharePoint file picker and download workflow Introduces end‑to‑end SharePoint import support: * Token exchange with Microsoft Graph and scope management (`useSharePointToken`) * Re‑usable hooks: `useSharePointPicker`, `useSharePointDownload`, `useSharePointFileHandling` * FileSearch dropdown now offers **From Local Machine** / **From SharePoint** sources and gracefully falls back when SharePoint is disabled * Agent upload model, `AttachFileMenu`, and `DropdownPopup` extended for SharePoint files and sub‑menus * Blurry overlay with progress indicator and `maxSelectionCount` limit during downloads * Cache‑flush utility (`config/flush-cache.js`) supporting Redis & filesystem, with dry‑run and npm script * Updated `SharePointIcon` (uses `currentColor`) and new i18n keys * Bug fixes: placeholder syntax in progress message, picker event‑listener cleanup * Misc style and performance optimizations * Fix ESLint warnings --------- Co-authored-by: Atef Bellaaj <slalom.bellaaj@external.daimlertruck.com>
35 lines
975 B
TypeScript
35 lines
975 B
TypeScript
import { Spinner, FileIcon } from '@librechat/client';
|
|
import type { TFile } from 'librechat-data-provider';
|
|
import type { ExtendedFile } from '~/common';
|
|
import SourceIcon from './SourceIcon';
|
|
import { cn } from '~/utils';
|
|
|
|
const FilePreview = ({
|
|
file,
|
|
fileType,
|
|
className = '',
|
|
}: {
|
|
file?: Partial<ExtendedFile | TFile>;
|
|
fileType: {
|
|
paths: React.FC;
|
|
fill: string;
|
|
title: string;
|
|
};
|
|
className?: string;
|
|
}) => {
|
|
return (
|
|
<div className={cn('relative size-10 shrink-0 overflow-hidden rounded-xl', className)}>
|
|
<FileIcon file={file} fileType={fileType} />
|
|
<SourceIcon source={file?.source} isCodeFile={!!file?.['metadata']?.fileIdentifier} />
|
|
{typeof file?.['progress'] === 'number' && file?.['progress'] < 1 && (
|
|
<Spinner
|
|
bgOpacity={0.2}
|
|
color="white"
|
|
className="absolute inset-0 m-2.5 flex items-center justify-center"
|
|
/>
|
|
)}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default FilePreview;
|