refac
This commit is contained in:
1 parent
45fcf272ef
commit
76854d1424
10 files changed
+146
-83
No files matched your search
@@ -65,6 +65,9 @@
|
||||
export let shiftKey = false;
|
||||
export let readonly = false;
|
||||
|
||||
export let ownerName: string | null = null;
|
||||
export let ownerUserId: string | null = null;
|
||||
|
||||
export let onDragEnd = () => {};
|
||||
|
||||
function formatTimeAgo(timestamp: number): string {
|
||||
@@ -534,6 +537,15 @@
|
||||
{/if}
|
||||
|
||||
<div class="flex self-center flex-1 w-full min-w-0">
|
||||
{#if ownerUserId}
|
||||
<Tooltip content={ownerName || 'Unknown'}>
|
||||
<img
|
||||
src="/api/v1/users/{ownerUserId}/profile/image"
|
||||
alt=""
|
||||
class="size-4 rounded-full shrink-0 object-cover mr-1.5"
|
||||
/>
|
||||
</Tooltip>
|
||||
{/if}
|
||||
{#if unread}
|
||||
<div class="shrink-0 self-center pr-2.5 flex transition-opacity duration-300">
|
||||
<div class="size-1.5 bg-sky-500 rounded-full" />
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { toast } from 'svelte-sonner';
|
||||
|
||||
import { chatId, mobile, selectedFolder, showSidebar } from '$lib/stores';
|
||||
import { chatId, mobile, selectedFolder, showSidebar, user } from '$lib/stores';
|
||||
|
||||
import {
|
||||
deleteFolderById,
|
||||
@@ -703,6 +703,9 @@
|
||||
createdAt={chat.created_at}
|
||||
updatedAt={chat.updated_at}
|
||||
lastReadAt={chat.last_read_at}
|
||||
ownerName={chat.owner_name ?? null}
|
||||
ownerUserId={chat.owner_name ? chat.user_id : null}
|
||||
readonly={chat.user_id !== $user?.id}
|
||||
{shiftKey}
|
||||
on:change={(e) => {
|
||||
dispatch('change', e.detail);
|
||||
|
||||
@@ -108,6 +108,8 @@
|
||||
title={chat.title}
|
||||
createdAt={chat.created_at}
|
||||
updatedAt={chat.updated_at}
|
||||
ownerName={chat.owner_name}
|
||||
ownerUserId={chat.user_id}
|
||||
readonly={chat.readonly ?? !isWritable}
|
||||
/>
|
||||
{/each}
|
||||
|
||||
Reference in new issue
Block a user