Feat: Modify the style of the dataset page #3221 (#7446)

### 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:
balibabu
2025-05-02 21:27:21 +08:00
committed by GitHub
parent fc379e90d1
commit cb37f00a8f
16 changed files with 211 additions and 153 deletions

View File

@ -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>
);
}