mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-02 08:35:08 +08:00
### What problem does this PR solve? Fix: bug fixes and icon replacement #10703 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -4,6 +4,7 @@ import Icon, { UserOutlined } from '@ant-design/icons';
|
||||
import { IconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
||||
import { Avatar } from 'antd';
|
||||
import { AvatarSize } from 'antd/es/avatar/AvatarContext';
|
||||
import { useIsDarkTheme } from './theme-provider';
|
||||
|
||||
const importAll = (requireContext: __WebpackModuleApi.RequireContext) => {
|
||||
const list = requireContext.keys().map((key) => {
|
||||
@ -74,4 +75,32 @@ export const LlmIcon = ({
|
||||
);
|
||||
};
|
||||
|
||||
export const HomeIcon = ({
|
||||
name,
|
||||
height = '32',
|
||||
width = '32',
|
||||
size = 'large',
|
||||
imgClass,
|
||||
}: {
|
||||
name: string;
|
||||
height?: string;
|
||||
width?: string;
|
||||
size?: AvatarSize;
|
||||
imgClass?: string;
|
||||
}) => {
|
||||
const isDark = useIsDarkTheme();
|
||||
const icon = isDark ? name : `${name}-bri`;
|
||||
|
||||
return icon ? (
|
||||
<SvgIcon
|
||||
name={`home-icon/${icon}`}
|
||||
width={width}
|
||||
height={height}
|
||||
imgClass={imgClass}
|
||||
></SvgIcon>
|
||||
) : (
|
||||
<Avatar shape="square" size={size} icon={<UserOutlined />} />
|
||||
);
|
||||
};
|
||||
|
||||
export default SvgIcon;
|
||||
|
||||
Reference in New Issue
Block a user