{searchQuery ? `Search: ${searchQuery}` : "Search"} — DSEC Notebook

Search

{ e.preventDefault(); const q = searchQuery.trim(); if (!q) return; window.location.href = `/search?q=${encodeURIComponent(q)}`; }} >
{#if loading}

Loading

{:else if ranQuery} {#if unitResults.length > 0}

Units

{#each unitResults as unit (unit._id)} {unit.code}{unit.code2 ? ` / ${unit.code2}` : ""} {unit.name} {#if unit.description}

{unit.description}

{/if}
{/each}
{/if} {#each postResults as result} {#if result.type === "note"} 0 ? `${result.authorName} · ${timeAgo(result.createdAt)} · ${result.commentCount} comment${result.commentCount === 1 ? "" : "s"}` : `${result.authorName} · ${timeAgo(result.createdAt)}`} voteCount={result.voteCount} targetType="note" targetId={result._id} tag="Note" /> {:else if result.type === "question"} 0 ? `${result.authorName} · ${timeAgo(result.createdAt)} · ${result.answerCount} answer${result.answerCount === 1 ? "" : "s"}` : `${result.authorName} · ${timeAgo(result.createdAt)}`} voteCount={result.voteCount} targetType="question" targetId={result._id} tag="Question" /> {/if} {:else} {#if unitResults.length === 0}

No results found for “{searchQuery}”.

{/if} {/each} {/if}