fix: align SynthesisListItem with backend response (preview fields, not sections)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
master
oabrivard 3 months ago
parent e1c37b520b
commit 1ca604401e

@ -58,6 +58,7 @@ const fr = {
'home.deleteTooltip': 'Supprimer',
'home.deleteConfirmTooltip': 'Cliquer a nouveau pour confirmer',
'home.noPreview': 'Aucune annonce majeure cette semaine.',
'home.previewCount': '{count} articles',
'home.loadError': 'Erreur lors du chargement des syntheses.',
'home.deleteError': 'Erreur lors de la suppression de la synthese.',
'home.generationInProgress': 'Une generation est en cours...',

@ -178,16 +178,13 @@ const Home: Component = () => {
</h3>
<div class="text-sm text-gray-600 space-y-1.5">
<Show
when={synth.sections?.[0]?.items?.length > 0}
fallback={
<p>{t('home.noPreview')}</p>
}
when={synth.first_section_title}
fallback={<p>{t('home.noPreview')}</p>}
>
<For each={synth.sections[0].items.slice(0, 4)}>
{(item) => (
<p class="line-clamp-2">&bull; {item.title}</p>
)}
</For>
<p class="font-medium text-gray-700">{synth.first_section_title}</p>
<p class="text-gray-500">
{t('home.previewCount', { count: String(synth.first_section_item_count) })}
</p>
</Show>
</div>
</div>

@ -122,9 +122,10 @@ export interface Synthesis {
export interface SynthesisListItem {
id: string;
week: string;
sections: NewsSection[];
status: string;
created_at: string;
first_section_title: string | null;
first_section_item_count: number;
}
export interface GenerateResponse {

Loading…
Cancel
Save