fix: move timestamp + Analyse button inline with article title

This commit is contained in:
caty21
2026-06-27 22:46:48 +02:00
parent 1e1b95fdc0
commit cc1c4caf5e
+19 -20
View File
@@ -351,13 +351,25 @@ function NewsCard({ item, secondary = false }: { item: NewsItem; secondary?: boo
)}
</div>
<a href={item.url} target="_blank" rel="noopener noreferrer"
className="group flex items-start gap-1.5 mb-1.5">
<span className={`text-[12px] leading-snug font-medium group-hover:text-white transition-colors ${secondary ? "text-slate-400" : "text-slate-200"}`}>
{item.title}
</span>
<ExternalLink size={10} className="text-slate-600 group-hover:text-slate-400 shrink-0 mt-0.5" />
</a>
{/* Titre + heure + Analyse sur la même ligne */}
<div className="flex items-start gap-2 mb-1.5">
<a href={item.url} target="_blank" rel="noopener noreferrer"
className="group flex items-start gap-1 flex-1 min-w-0">
<span className={`text-[12px] leading-snug font-medium group-hover:text-white transition-colors ${secondary ? "text-slate-400" : "text-slate-200"}`}>
{item.title}
</span>
<ExternalLink size={10} className="text-slate-600 group-hover:text-slate-400 shrink-0 mt-0.5" />
</a>
<div className="flex items-center gap-1 shrink-0 mt-0.5">
<span className="text-[9px] text-slate-600 whitespace-nowrap">{formatRelativeTime(item.publishedAt)}</span>
{!secondary && (
<button onClick={() => setExpanded(e => !e)}
className="text-[9px] text-slate-500 hover:text-slate-300 px-1.5 py-0.5 rounded-full border border-slate-700/30 transition-colors whitespace-nowrap">
{expanded ? "▲" : "▼ Analyse"}
</button>
)}
</div>
</div>
{item.summary && !secondary && (
<p className="text-[11px] text-slate-500 mb-1.5 leading-relaxed line-clamp-2">
@@ -380,22 +392,9 @@ function NewsCard({ item, secondary = false }: { item: NewsItem; secondary?: boo
<Minus size={9} />}
</div>
))}
<div className="ml-auto flex items-center gap-1.5 shrink-0">
<span className="text-[10px] text-slate-600">{formatRelativeTime(item.publishedAt)}</span>
{!secondary && (
<button onClick={() => setExpanded(e => !e)}
className="text-[9px] text-slate-500 hover:text-slate-300 px-1.5 py-0.5 rounded-full border border-slate-700/30 transition-colors">
{expanded ? "▲" : "▼ Analyse"}
</button>
)}
</div>
</div>
)}
{!secondary && item.impacts.length === 0 && (
<span className="text-[10px] text-slate-600">{formatRelativeTime(item.publishedAt)}</span>
)}
{expanded && item.impacts.length > 0 && (
<div className="mt-2 space-y-1.5 border-t border-slate-700/30 pt-2">
{item.impacts.map(imp => (