{#if $user?.role === 'admin'}
{/if}
{#each $chats.filter((chat) => {
if (search === '') {
return true;
} else {
let title = chat.title.toLowerCase();
if (title.includes(search)) {
return true;
} else {
return false;
}
}
}) as chat, i}
{#if chat.id === $chatId}
{#if chatTitleEditId === chat.id}
{:else if chatDeleteId === chat.id}
{:else}
{/if}
{/if}
{/each}
{#if $user !== undefined}
{#if showDropdown}
{#if $user.role === 'admin'}
{/if}
{/if}
{:else}
{/if}