--- import type { Device } from '@/lib/schema'; import { deviceTitle } from '@/lib/utils'; interface Props { device: Device; /** 紧凑模式:隐藏简介,用于首页等轻量列表 */ compact?: boolean; } const { device, compact = false } = Astro.props; const title = deviceTitle(device.brand, device.model); const lifecycleText = device.lifecycle === 'discontinued' ? '已停产' : device.lifecycle === 'announced' ? '已发布' : '在售'; const stats = [ { label: 'SoC', value: device.specs.platform?.chipset ?? '—' }, { label: '屏幕', value: device.specs.display?.size ?? '—' }, { label: '电池', value: device.specs.battery?.capacity ?? '—' }, { label: '重量', value: device.specs.body?.weight ?? '—' }, ]; ---
{title}
{ stats.map((stat) => ( <>
{stat.label}
{stat.value}
)) }
{!compact && device.summary &&

{device.summary}

}
{lifecycleText}