Skip to content

Commit

Permalink
Derive lxlQualifier plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperengstrom committed Dec 17, 2024
1 parent 39d57bb commit ae6aa60
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lxl-web/src/lib/components/Search.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,13 @@
return data;
}
function getLabels(key: string, value?: string) {
let pageMapping = $page.data.searchResult?.mapping;
return getLabelFromMappings(key, value, pageMapping, suggestMapping);
}
let derivedLxlQualifierPlugin = $derived.by(() => {
function getLabels(key: string, value?: string) {
let pageMapping = $page.data.searchResult?.mapping;
return getLabelFromMappings(key, value, pageMapping, suggestMapping);
}
return lxlQualifierPlugin(getLabels);
});
</script>

<form class="relative w-full" action="find" onsubmit={handleSubmit}>
Expand All @@ -93,7 +96,7 @@
})}
transformFn={handleTransform}
paginationQueryFn={handlePaginationQuery}
extensions={[lxlQualifierPlugin(getLabels)]}
extensions={[derivedLxlQualifierPlugin]}
>
{#snippet resultItem(item)}
<button type="button">
Expand Down

0 comments on commit ae6aa60

Please sign in to comment.