@ -12,7 +12,7 @@ import { useI18n } from '~/i18n';
import { synthesesApi } from '~/api/syntheses' ;
import { isApiError } from '~/types' ;
import type { SynthesisListItem } from '~/types' ;
import { extractWeekNumber , formatDate } from '~/utils/dates' ;
import { extractWeekNumber , formatDate , formatTime } from '~/utils/dates' ;
import LoadingSpinner from '~/components/ui/LoadingSpinner' ;
/ * *
@ -168,29 +168,34 @@ const Home: Component = () => {
{ ( synth ) = > (
< A
href = { ` /synthesis/ ${ synth . id } ` }
class = " block bg-white rounded-xl shadow-sm border border-gray-200 hover:shadow-md hover:border-indigo-300 transition-all duration-200 overflow-hidden"
class = " flex flex-col bg-white rounded-xl shadow-sm border border-gray-200 hover:shadow-md hover:border-indigo-300 transition-all duration-200 overflow-hidden"
>
< div class = "p-6 ">
< div class = "p-6 flex-1 ">
< div class = "flex items-center justify-between mb-4" >
< span class = "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-800" >
{ t ( 'home.weekLabel' , { week : extractWeekNumber ( synth . week ) } ) }
< / span >
< span class = "text-sm text-gray-500" >
{ formatDate ( synth . created_at ) }
< / span >
< div class = "text-right" >
< div class = "text-sm text-gray-500" > { formatDate ( synth . created_at ) } < / div >
< div class = "text-xs text-gray-400" > { formatTime ( synth . created_at ) } < / div >
< / div >
< / div >
< h3 class = "text-lg font-semibold text-gray-900 mb- 2 ">
< h3 class = "text-lg font-semibold text-gray-900 mb- 3 ">
{ t ( 'home.cardTitle' ) }
< / h3 >
< div class = " text-sm text-gray-600 space-y-1.5 ">
< div class = " space-y-1">
< Show
when = { synth . first_section_title }
fallback = { < p > { t ( 'home.noPreview' ) } < / p > }
when = { synth . sections_summary && synth . sections_summary . length > 0 }
fallback = { < p class = "text-sm text-gray-400" > { t ( 'home.noPreview' ) } < / p > }
>
< 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 >
< For each = { synth . sections_summary } >
{ ( section ) = > (
< div class = "flex items-center justify-between text-sm" >
< span class = "text-gray-700 truncate mr-2" > { section . title } < / span >
< span class = "text-gray-400 text-xs whitespace-nowrap" > ( { section . count } ) < / span >
< / div >
) }
< / For >
< / Show >
< / div >
< / div >