Skip to content

Commit

Permalink
chore(headless): add a wider range of types for the ssr-commerce summ…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexprudhomme committed Nov 6, 2024
1 parent 566bcc8 commit 6b2b08d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,12 @@ export function defineSummary<
solutionType === SolutionType.listing
? buildProductListing(engine).summary()
: buildSearch(engine).summary(),
} as SubControllerDefinitionWithoutProps<Summary, TOptions>;
} as SubControllerDefinitionWithoutProps<
Summary<
| ProductListingSummaryState
| SearchSummaryState
| RecommendationsSummaryState
>,
TOptions
>;
}
11 changes: 5 additions & 6 deletions packages/samples/headless-ssr-commerce/components/summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ export default function Summary() {
return null;
}

// TODO: add query to summary state
// return (
// <span>
// for <b>{state.query}</b>
// </span>
// );
return (
<span>
for <b>{state.query}</b>
</span>
);
};

const renderSummary = () => {
Expand Down

0 comments on commit 6b2b08d

Please sign in to comment.