{#if type == 'community'} { const results = await getClient().search({ q: q || ' ', type_: 'Communities', limit: 20, listing_type: listing_type, sort: 'TopAll', }) return results.communities.map((c) => c.community) }} extractName={(c) => `${c.title}@${new URL(c.actor_id).hostname}`} on:select bind:q {showWhenEmpty} {...$$restProps} let:item let:select >
{#if q == '' && showWhenEmpty} dispatcher('select', undefined)}>
None
{:else} No results. {/if}
select(item)}>
{item.title} {new URL(item.actor_id).hostname}
{/if}