Show dish thumbnail in split-bill subaccount line items
Same fix as the regular cart: the split-bill subaccount rows showed only name + price + quantity. Render the dish photo as a thumbnail (MediaThumb, with the plate-icon fallback).
This commit is contained in:
1 parent
7933e35fc3
commit
02a0163d60
1 file changed
+6
@@ -5,6 +5,7 @@ import { useLocale, useTranslations } from 'next-intl';
|
||||
import type { Locale } from '@/i18n/config';
|
||||
import type { SnapshotProduct } from '@/lib/types';
|
||||
import { pickText } from '@/lib/text';
|
||||
import MediaThumb from './MediaThumb';
|
||||
|
||||
export type SplitSession = { id: string; name: string; table: number };
|
||||
type CartLine = { product: SnapshotProduct; qty: number; note?: string };
|
||||
@@ -185,6 +186,11 @@ export default function SplitPanel({
|
||||
{cart.map((l) => (
|
||||
<div key={l.product.id} className="glass-soft flex flex-col gap-2 rounded-2xl px-3 py-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<MediaThumb
|
||||
media={[...l.product.media].sort((a, b) => a.order - b.order)[0]}
|
||||
alt={pickText(l.product.name, locale)}
|
||||
className="h-12 w-12 shrink-0 rounded-xl"
|
||||
/>
|
||||
<span className="min-w-0 flex-1 text-sm font-medium">
|
||||
{pickText(l.product.name, locale)}
|
||||
</span>
|
||||
|
||||
Reference in new issue
Block a user