diff --git a/src/app/globals.css b/src/app/globals.css index 1317d4e..8925a0b 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -122,4 +122,9 @@ body { .safe-abs-top { top: calc(env(safe-area-inset-top, 0px) + 0.5rem); } + /* full-screen modal/sheet overlays: keep content clear of island + gesture bar */ + .safe-modal { + padding-top: calc(env(safe-area-inset-top, 0px) + 0.75rem); + padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem); + } } diff --git a/src/components/public/AiConsultant.tsx b/src/components/public/AiConsultant.tsx index 706c37f..ccebada 100644 --- a/src/components/public/AiConsultant.tsx +++ b/src/components/public/AiConsultant.tsx @@ -2,11 +2,28 @@ import { useState } from 'react'; import { useLocale, useTranslations } from 'next-intl'; +import type { SnapshotProduct } from '@/lib/types'; +import SuggestionCarousel from './SuggestionCarousel'; type Recommendation = { dish: string; reason: string; type?: 'direct' | 'complement' }; -export default function AiConsultant({ slug, onClose }: { slug: string; onClose: () => void }) { +export default function AiConsultant({ + slug, + onClose, + ordersEnabled, + onAdd, + resolveDish, + suggestions, +}: { + slug: string; + onClose: () => void; + ordersEnabled: boolean; + onAdd: (p: SnapshotProduct) => void; + resolveDish: (name: string) => SnapshotProduct | undefined; + suggestions: SnapshotProduct[]; +}) { const t = useTranslations('ai'); + const tm = useTranslations('menu'); const locale = useLocale(); const [question, setQuestion] = useState(''); const [loading, setLoading] = useState(false); @@ -35,8 +52,28 @@ export default function AiConsultant({ slug, onClose }: { slug: string; onClose: } } + function Card(r: Recommendation, key: number) { + const product = resolveDish(r.dish); + return ( +
{r.reason}
+{t('intro')}
- )} + {!answer && !loading &&{t('intro')}
} {loading &&{t('thinking')}
} {error &&⚠️
} {answer && ( @@ -57,15 +92,9 @@ export default function AiConsultant({ slug, onClose }: { slug: string; onClose: {(() => { const direct = answer.recommendations.filter((r) => r.type !== 'complement'); const complement = answer.recommendations.filter((r) => r.type === 'complement'); - const Card = (r: Recommendation, i: number) => ( -{r.reason}
-@@ -79,6 +108,13 @@ export default function AiConsultant({ slug, onClose }: { slug: string; onClose: })()}