{#if filteredItems.length > 0 || command?.substring(1).startsWith('http')}
{#each filteredItems as item, idx}
{ console.log(item); confirmSelect('knowledge', item); }} on:mousemove={() => { selectedIdx = idx; }} >
{#if item.legacy}
Legacy
{:else if item?.meta?.document}
Document
{:else if item?.type === 'file'}
File
{:else}
Collection
{/if}
{decodeString(item?.name)}
{item?.description}
{/each} {#if command.substring(1).startsWith('https://www.youtube.com') || command .substring(1) .startsWith('https://youtu.be')}
{ if (isValidHttpUrl(command.substring(1))) { confirmSelect('youtube', command.substring(1)); } else { toast.error( $i18n.t( 'Oops! Looks like the URL is invalid. Please double-check and try again.' ) ); } }} >
{command.substring(1)}
{$i18n.t('Youtube')}
{:else if command.substring(1).startsWith('http')}
{ if (isValidHttpUrl(command.substring(1))) { confirmSelect('web', command.substring(1)); } else { toast.error( $i18n.t( 'Oops! Looks like the URL is invalid. Please double-check and try again.' ) ); } }} >
{command}
{$i18n.t('Web')}
{/if}
{/if}