Skip to content

Commit 7b4d16d

Browse files
authored
Merge pull request #120 from kaplax/main
chore: Add empty state illustration and improve model selector UI when
2 parents 0fe3bb8 + 4b1b664 commit 7b4d16d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
Lines changed: 1 addition & 0 deletions
Loading

himarket-web/himarket-frontend/src/components/chat/ModelSelector.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useState } from "react";
22
import { DownOutlined, CheckOutlined, SearchOutlined } from "@ant-design/icons";
33
import { Dropdown, Input, Tabs, Spin } from "antd";
44
import { ProductIconRenderer } from "../icon/ProductIconRenderer";
5+
import EmptyData from "../../assets/empty-data.svg";
56
import type { ICategory, IProductDetail } from "../../lib/apis";
67

78

@@ -29,7 +30,7 @@ export function ModelSelector({
2930
const currentModel = modelList.find(m => m.productId === selectedModelId) || modelList[0];
3031

3132
// 根据分类和搜索过滤模型
32-
const filteredModels = modelList.filter(model => {
33+
const filteredModels = modelList.filter(model => {
3334
// 分类过滤:如果选择"全部"或模型的 productCategories 包含当前选中的分类
3435
const matchesCategory = activeCategory === "all" ||
3536
model.categories.map(c => c.categoryId).includes(activeCategory);
@@ -113,8 +114,12 @@ export function ModelSelector({
113114
</div>
114115
))}
115116
{!loading && filteredModels.length === 0 && (
116-
<div className="text-center py-8 text-gray-400">
117-
未找到匹配的模型
117+
<div className="text-center flex gap-4 flex-col items-center justify-center py-14 text-gray-400">
118+
<img src={EmptyData} />
119+
<div className="text-[#333] text-[16px] font-medium">
120+
暂无模型
121+
</div>
122+
<div className="text-[#333]">您需要首先在 Admin 中配置模型,才能在 HiChat 中体验</div>
118123
</div>
119124
)}
120125
</div>

0 commit comments

Comments
 (0)