mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-01 15:10:14 +00:00
feat(优化原生AI摘要功能显示情况): 没有数据不加载,默认渲染完整摘要,利于SEO
(cherry picked from commit 1964bc96fdce688129287594103e6555fb42c779)
This commit is contained in:
@@ -4,41 +4,43 @@ import { useGlobal } from '@/lib/global'
|
|||||||
|
|
||||||
const AISummary = ({ aiSummary }) => {
|
const AISummary = ({ aiSummary }) => {
|
||||||
const { locale } = useGlobal()
|
const { locale } = useGlobal()
|
||||||
const [summary, setSummary] = useState(locale.AI_SUMMARY.GENERATING + '...')
|
const [summary, setSummary] = useState(aiSummary)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
showAiSummaryAnimation(aiSummary, setSummary)
|
showAiSummaryAnimation(aiSummary, setSummary)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles['post-ai']}>
|
aiSummary && (
|
||||||
<div className={styles['ai-container']}>
|
<div className={styles['post-ai']}>
|
||||||
<div className={styles['ai-header']}>
|
<div className={styles['ai-container']}>
|
||||||
<div className={styles['ai-icon']}>
|
<div className={styles['ai-header']}>
|
||||||
<svg
|
<div className={styles['ai-icon']}>
|
||||||
xmlns='http://www.w3.org/2000/svg'
|
<svg
|
||||||
viewBox='0 0 24 24'
|
xmlns='http://www.w3.org/2000/svg'
|
||||||
width='24'
|
viewBox='0 0 24 24'
|
||||||
height='24'>
|
width='24'
|
||||||
<path
|
height='24'>
|
||||||
fill='#ffffff'
|
<path
|
||||||
d='M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8Z'
|
fill='#ffffff'
|
||||||
/>
|
d='M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8Z'
|
||||||
</svg>
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div className={styles['ai-title']}>{locale.AI_SUMMARY.NAME}</div>
|
||||||
|
<div className={styles['ai-tag']}>GPT</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles['ai-title']}>{locale.AI_SUMMARY.NAME}</div>
|
<div className={styles['ai-content']}>
|
||||||
<div className={styles['ai-tag']}>GPT</div>
|
<div className={styles['ai-explanation']}>
|
||||||
</div>
|
{summary}
|
||||||
<div className={styles['ai-content']}>
|
{summary !== aiSummary && (
|
||||||
<div className={styles['ai-explanation']}>
|
<span className={styles['blinking-cursor']}></span>
|
||||||
{summary}
|
)}
|
||||||
{summary !== aiSummary && (
|
</div>
|
||||||
<span className={styles['blinking-cursor']}></span>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,5 @@ export default {
|
|||||||
},
|
},
|
||||||
AI_SUMMARY: {
|
AI_SUMMARY: {
|
||||||
NAME: 'AI intelligent summary',
|
NAME: 'AI intelligent summary',
|
||||||
GENERATING: 'Generating'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,5 @@ export default {
|
|||||||
},
|
},
|
||||||
AI_SUMMARY: {
|
AI_SUMMARY: {
|
||||||
NAME: "Résumé intelligent par l'IA",
|
NAME: "Résumé intelligent par l'IA",
|
||||||
GENERATING: 'Génération en cours'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,5 @@ export default {
|
|||||||
},
|
},
|
||||||
AI_SUMMARY: {
|
AI_SUMMARY: {
|
||||||
NAME: 'AIインテリジェントサマリー',
|
NAME: 'AIインテリジェントサマリー',
|
||||||
GENERATING: '生成中'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,5 @@ export default {
|
|||||||
},
|
},
|
||||||
AI_SUMMARY: {
|
AI_SUMMARY: {
|
||||||
NAME: 'Yapay Zeka Akıllı Özet',
|
NAME: 'Yapay Zeka Akıllı Özet',
|
||||||
GENERATING: 'Oluşturuluyor'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,5 @@ export default {
|
|||||||
},
|
},
|
||||||
AI_SUMMARY: {
|
AI_SUMMARY: {
|
||||||
NAME: 'AI智能摘要',
|
NAME: 'AI智能摘要',
|
||||||
GENERATING: '生成中'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,5 @@ export default {
|
|||||||
},
|
},
|
||||||
AI_SUMMARY: {
|
AI_SUMMARY: {
|
||||||
NAME: 'AI智能摘要',
|
NAME: 'AI智能摘要',
|
||||||
GENERATING: '生成中'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,5 @@ export default {
|
|||||||
},
|
},
|
||||||
AI_SUMMARY: {
|
AI_SUMMARY: {
|
||||||
NAME: 'AI智能摘要',
|
NAME: 'AI智能摘要',
|
||||||
GENERATING: '生成中'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user