{$i18n.t("{{user}}'s Chats", { user: user.name })}

{#if chats.length > 0}
{#each chats.sort((a, b) => { if (a[sortKey] < b[sortKey]) return sortOrder === 'asc' ? -1 : 1; if (a[sortKey] > b[sortKey]) return sortOrder === 'asc' ? 1 : -1; return 0; }) as chat, idx} {/each}
setSortKey('title')} > {$i18n.t('Title')} {#if sortKey === 'title'} {sortOrder === 'asc' ? '▲' : '▼'} {:else} {/if} setSortKey('created_at')} > {$i18n.t('Created at')} {#if sortKey === 'created_at'} {sortOrder === 'asc' ? '▲' : '▼'} {:else} {/if}
{chat.title}
{dayjs(chat.created_at * 1000).format($i18n.t('MMMM DD, YYYY HH:mm'))}
{:else}
{user.name} {$i18n.t('has no conversations.')}
{/if}