Show dish thumbnails in AI consultant recommendations
The consultant cards (both direct recommendations and the 'Para acompañar' complements) showed only name + reason. Each card already resolves the real product for its Add button, so render its photo as a thumbnail (MediaThumb, which falls back to the plate icon when media is missing or fails to load).
This commit is contained in:
1 parent
595769ced0
commit
8cf6ca8cb5
1 file changed
+9
@@ -4,6 +4,7 @@ import { useMemo, useState } from 'react';
|
||||
import { useLocale, useTranslations } from 'next-intl';
|
||||
import type { SnapshotProduct } from '@/lib/types';
|
||||
import SuggestionCarousel from './SuggestionCarousel';
|
||||
import MediaThumb from './MediaThumb';
|
||||
|
||||
type Recommendation = { dish: string; reason: string; type?: 'direct' | 'complement' };
|
||||
|
||||
@@ -63,8 +64,16 @@ export default function AiConsultant({
|
||||
|
||||
function Card(r: Recommendation, key: number) {
|
||||
const product = resolveDish(r.dish);
|
||||
const cover = product ? [...product.media].sort((a, b) => a.order - b.order)[0] : undefined;
|
||||
return (
|
||||
<div key={key} className="glass-soft flex items-start gap-3 rounded-2xl p-4">
|
||||
{product && (
|
||||
<MediaThumb
|
||||
media={cover}
|
||||
alt={r.dish}
|
||||
className="h-14 w-14 shrink-0 rounded-xl"
|
||||
/>
|
||||
)}
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="font-semibold" style={{ color: '#1e3a5f' }}>{r.dish}</div>
|
||||
<p className="text-sm text-[var(--text)]/80">{r.reason}</p>
|
||||
|
||||
Reference in new issue
Block a user