修复客户端资源图标显示
This commit is contained in:
@@ -38,6 +38,7 @@ import {
|
||||
UploadOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import type { ColumnsType } from "antd/es/table";
|
||||
import ImageWithFallback from "../common/ImageWithFallback";
|
||||
import {
|
||||
AiAgentContext,
|
||||
AiManualComponent,
|
||||
@@ -1213,22 +1214,18 @@ export default function KnowledgePage() {
|
||||
|
||||
const renderKnowledgeIcon = (
|
||||
knowledge: KnowledgeComponent | KnowledgeInfo | null,
|
||||
) => {
|
||||
if (knowledge?.icon) {
|
||||
return (
|
||||
<img
|
||||
className={styles.knowledgeIconImage}
|
||||
src={knowledge.icon}
|
||||
alt=""
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<span className={styles.knowledgeIconText}>
|
||||
{getInitial(knowledge?.name)}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
) => (
|
||||
<ImageWithFallback
|
||||
className={styles.knowledgeIconImage}
|
||||
src={knowledge?.icon}
|
||||
alt=""
|
||||
fallback={
|
||||
<span className={styles.knowledgeIconText}>
|
||||
{getInitial(knowledge?.name)}
|
||||
</span>
|
||||
}
|
||||
/>
|
||||
);
|
||||
|
||||
const renderCreateButton = (variant: "header" | "toolbar" | "empty") => (
|
||||
<Button
|
||||
@@ -1809,7 +1806,11 @@ export default function KnowledgePage() {
|
||||
onClick={() => iconFileInputRef.current?.click()}
|
||||
>
|
||||
<span className={styles.iconPreview}>
|
||||
{iconUrl ? <img src={iconUrl} alt="" /> : <PictureOutlined />}
|
||||
<ImageWithFallback
|
||||
src={iconUrl}
|
||||
alt=""
|
||||
fallback={<PictureOutlined />}
|
||||
/>
|
||||
</span>
|
||||
<span className={styles.iconUploadText}>
|
||||
<strong>
|
||||
|
||||
Reference in New Issue
Block a user