No Results Found
Try adjusting your search or filters.
`;
}
const { selectedLanguage = null } = options;
const byCookbook = new Map<
string,
{ cookbook: Cookbook; recipes: { recipe: Recipe; highlightedName?: string }[] }
>();
matches.forEach(({ cookbook, recipe, highlightedName }) => {
if (!byCookbook.has(cookbook.id)) {
byCookbook.set(cookbook.id, { cookbook, recipes: [] });
}
byCookbook.get(cookbook.id)?.recipes.push({ recipe, highlightedName });
});
let html = "";
byCookbook.forEach(({ cookbook, recipes }) => {
html += renderCookbookSection(cookbook, recipes, selectedLanguage);
});
return html;
}
function renderCookbookSection(
cookbook: Cookbook,
recipes: { recipe: Recipe; highlightedName?: string }[],
selectedLanguage: string | null
): string {
const languageTabs = cookbook.languages
.map(
(language) => `