Fix: bug fixes and icon replacement #10703 (#10814)

### 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:
chanx
2025-10-27 19:02:18 +08:00
committed by GitHub
parent b7cb4d3e35
commit 0089e2b30c
22 changed files with 165 additions and 25 deletions

View File

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