mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Modify the style of the dataset page #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
import { FileIconMap } from '@/constants/file';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { getExtension } from '@/utils/document-util';
|
||||
|
||||
type IconFontType = {
|
||||
name: string;
|
||||
@ -10,3 +12,18 @@ export const IconFont = ({ name, className }: IconFontType) => (
|
||||
<use xlinkHref={`#icon-${name}`} />
|
||||
</svg>
|
||||
);
|
||||
|
||||
export function FileIcon({
|
||||
name,
|
||||
className,
|
||||
type,
|
||||
}: IconFontType & { type?: string }) {
|
||||
const isFolder = type === 'folder';
|
||||
return (
|
||||
<span className={cn('size-4', className)}>
|
||||
<IconFont
|
||||
name={isFolder ? 'file' : FileIconMap[getExtension(name)]}
|
||||
></IconFont>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user