no results case

This commit is contained in:
Peter Clement 2024-01-11 14:26:25 +00:00
parent 30cbcff1b1
commit cc87213071
1 changed files with 14 additions and 12 deletions

View File

@ -30,6 +30,8 @@
return lowerA > lowerB ? 1 : -1
})
$: showNoResults = searchString && !filteredAutomations.length
onMount(async () => {
try {
await automationStore.actions.fetch()
@ -53,18 +55,18 @@
/>
</div>
<div class="side-bar-nav">
{#if filteredAutomations.length}
{#each filteredAutomations as automation}
<NavItem
text={automation.name}
selected={automation._id === selectedAutomationId}
on:click={() => selectAutomation(automation._id)}
selectedBy={$userSelectedResourceMap[automation._id]}
>
<EditAutomationPopover {automation} />
</NavItem>
{/each}
{:else}
{#each filteredAutomations as automation}
<NavItem
text={automation.name}
selected={automation._id === selectedAutomationId}
on:click={() => selectAutomation(automation._id)}
selectedBy={$userSelectedResourceMap[automation._id]}
>
<EditAutomationPopover {automation} />
</NavItem>
{/each}
{#if showNoResults}
<Layout paddingY="none" paddingX="L">
<div class="no-results">
There aren't any automations matching that name