refactor(web): 残留自制控件统一替换为 antd 组件

- 状态点自制徽标改用 Badge,回收站剩余天数紧急态改用红色 Tag
- 危险按钮改用 danger 属性并补充语言,text+danger 不套实心红样式
- 后台搜索框改 antd Input 前缀形态,删除手写容器与聚焦环样式
- 加载态统一 Spin/Skeleton(Table 用 loading),空态统一 Empty
- Segmented 选项计数改用 Badge count,弱化为 muted 灰
- 首页分页说明改 Pagination showTotal,笔记错误态改 Empty 承接布局
- 代码块复制按钮改 antd Button 并增加「已复制」反馈,修复悬浮不显示
- 博客/后台图标按钮与溢出菜单触发器统一为 antd Button type=text
This commit is contained in:
2026-09-09 15:37:36 +08:00
parent 969d537aee
commit 92d89717c5
11 changed files with 219 additions and 283 deletions
+19 -8
View File
@@ -1,7 +1,7 @@
import { Link, useNavigate, useParams } from 'react-router'
import { useQuery } from '@tanstack/react-query'
import { ArrowLeft, ArrowRight, Clock, Eye } from 'lucide-react'
import { Alert, Button, Card, Tag } from 'antd'
import { Alert, Button, Card, Empty, Skeleton, Tag } from 'antd'
import { api } from '../lib/api'
import type { NoteDetail } from '../lib/api'
import { useAuth } from '../lib/auth'
@@ -20,17 +20,28 @@ export default function Note() {
})
useDocumentTitle(note?.title)
if (isLoading) return <p className="pn-home-list-empty">加载中…</p>
if (isLoading) {
return (
<article className="pn-note-article">
<Skeleton active title paragraph={{ rows: 6 }} />
</article>
)
}
if (error || !note) {
return (
<div className="pn-note-article">
<p className="pn-home-list-empty">笔记不存在或未公开</p>
<p style={{ textAlign: 'center', marginTop: -40 }}>
<Button type="text" size="small" className="pn-note-back" icon={<ArrowLeft size={14} />} onClick={() => navigate('/')}>
<article className="pn-note-article">
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="笔记不存在或未公开">
<Button
type="text"
size="small"
className="pn-note-back"
icon={<ArrowLeft size={14} />}
onClick={() => navigate('/')}
>
返回首页
</Button>
</p>
</div>
</Empty>
</article>
)
}