{:else if kind === "discosort"} {@const c = top().c} {@const ord = c.order || "new"} {@const byName = ord === "az" || ord === "za"} {@const grp = byName ? "none" : (c.group ?? "year")}
Sort & group
Order
{#each [["new", "Newest first"], ["old", "Oldest first"], ["az", "A–Z"], ["za", "Z–A"]] as [k, l] (k)} {/each}
Group
{#each [["year", "By year"], ["none", "None"]] as [k, l] (k)} {/each}
{#if byName}
By year needs a date order — under A–Z the years would repeat out of sequence.
{/if}