PackagesStep: look up selected package in both primary + same-provider-more lists
Clicking a package in the "Other packages from [Provider]" section set the selectedPackageId correctly but the detail panel stayed on the empty state — `selectedPackage` was derived only from the primary `packages` array, so secondary-list ids never resolved. Now falls back to the secondary list when the primary miss. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -214,7 +214,14 @@ export const PackagesStep: React.FC<PackagesStepProps> = ({
|
||||
sx,
|
||||
}) => {
|
||||
const copy = TIER_COPY[providerTier];
|
||||
const selectedPackage = packages.find((p) => p.id === selectedPackageId);
|
||||
// Look up the selected package across BOTH the primary list and the
|
||||
// same-provider-more secondary list — tapping "Premium Funeral Service"
|
||||
// in the "Other packages from X" section should surface its detail too.
|
||||
const selectedPackage =
|
||||
packages.find((p) => p.id === selectedPackageId) ??
|
||||
(secondaryList?.kind === 'same-provider-more'
|
||||
? secondaryList.packages.find((p) => p.id === selectedPackageId)
|
||||
: undefined);
|
||||
|
||||
// Mobile drill-in: on mobile, the list is the default view — only when the
|
||||
// user explicitly taps a package do we swap in the detail panel. This
|
||||
|
||||
Reference in New Issue
Block a user