mirror of
https://github.com/LiuYuYang01/ThriveX-Blog.git
synced 2026-07-06 21:34:37 +08:00
优化文章摘要组件,调整样式以增加底部边距,并更新标题文本为“AI总结”,同时修复内容显示逻辑,确保在内容存在时正确渲染。
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
border-radius: 12px;
|
||||
padding: 12px;
|
||||
border: 1px solid;
|
||||
margin: 8px 0 16px;
|
||||
margin: 8px 0 40px;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
:root & {
|
||||
|
||||
@@ -32,34 +32,33 @@ export default function Summary({ content }: SummaryProps) {
|
||||
}, [currentIndex, content]);
|
||||
|
||||
return (
|
||||
<div className="post-ai" data-nosnippet="">
|
||||
<div className="post-ai" data-nosnippet="" style={{ display: content.length ? 'block' : 'none' }}>
|
||||
<div className="ai-title">
|
||||
<div className="ai-title-left">
|
||||
<div className="ai-title-text">文章摘要</div>
|
||||
<div className="ai-title-text">AI总结</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="ai-tag"
|
||||
id="ai-tag"
|
||||
title="了解助理"
|
||||
onClick={handleThriveGPTClick} // TODO: 实现后完善交互逻辑
|
||||
>
|
||||
ThriveGPT
|
||||
</div>
|
||||
onClick={handleThriveGPTClick}
|
||||
>ThriveX GPT</div>
|
||||
</div>
|
||||
|
||||
<div className="ai-explanation">
|
||||
{displayText}
|
||||
{currentIndex < content.length && <span className="cursor">|</span>}
|
||||
</div>
|
||||
|
||||
{showSuggestions && (
|
||||
<div className="ai-suggestions">
|
||||
{suggestions.map((item, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="ai-suggestions-item"
|
||||
// TODO: 添加点击处理逻辑
|
||||
>
|
||||
{item}
|
||||
</div>
|
||||
// TODO: 添加点击处理逻辑
|
||||
>{item}</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -15,8 +15,6 @@ import { getSwiperListAPI } from '@/api/swiper'
|
||||
export default async ({ page }: { page: number }) => {
|
||||
const { data: swiper } = await getSwiperListAPI() || { data: [] as SwiperType[] }
|
||||
const { data: theme } = await getConfigDataAPI<Theme>("layout") || { data: {} as Theme }
|
||||
console.log(333, theme);
|
||||
|
||||
const sidebar: string[] = theme?.right_sidebar && JSON.parse(theme?.right_sidebar)
|
||||
|
||||
// 如果是瀑布流布局就显示28条数据,否则显示8条
|
||||
|
||||
Reference in New Issue
Block a user