refactor: 项目详情页预览框改为条件渲染,无演示内容时不显示占位符
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -108,24 +108,17 @@ export async function ProjectDetail({ project, locale }: ProjectDetailProps) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Featured Image/Video Placeholder */}
|
{/* Featured Image/Video Placeholder - only show if source exists */}
|
||||||
<div className="relative w-full aspect-video border-2 border-black dark:border-gray-600 bg-gray-100 dark:bg-gray-800 mb-10 overflow-hidden shadow-brutal dark:shadow-brutal-dark flex items-center justify-center">
|
{project.source && (
|
||||||
{project.source ? (
|
<div className="relative w-full aspect-video border-2 border-black dark:border-gray-600 bg-gray-100 dark:bg-gray-800 mb-10 overflow-hidden shadow-brutal dark:shadow-brutal-dark">
|
||||||
<iframe
|
<iframe
|
||||||
src={project.source}
|
src={project.source}
|
||||||
className="w-full h-full"
|
className="w-full h-full"
|
||||||
title={`${displayName} demo`}
|
title={`${displayName} demo`}
|
||||||
allowFullScreen
|
allowFullScreen
|
||||||
/>
|
/>
|
||||||
) : (
|
</div>
|
||||||
<div className="text-center">
|
)}
|
||||||
<span className="material-icons text-6xl text-gray-400 dark:text-gray-600 mb-2">
|
|
||||||
smart_toy
|
|
||||||
</span>
|
|
||||||
<p className="text-gray-500 dark:text-gray-400 font-display text-sm">{t('projectPreview')}</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{/* Article Content */}
|
{/* Article Content */}
|
||||||
|
|||||||
Reference in New Issue
Block a user