|
397 | 397 | {#each filteredUsers as user (user.id)} |
398 | 398 | <div class="rounded-lg border p-2 px-3"> |
399 | 399 | <div class="flex items-center justify-between"> |
400 | | - <div class="flex items-center gap-2"> |
401 | | - {#if editingUserId === user.id} |
402 | | - <input |
403 | | - class="w-48 rounded-md border bg-background px-2 py-0.5 text-sm" |
404 | | - bind:value={editingName} |
405 | | - onkeydown={(e) => { |
406 | | - if (e.key === 'Enter') saveEditingName(); |
407 | | - if (e.key === 'Escape') editingUserId = null; |
408 | | - }} |
409 | | - /> |
410 | | - <button |
411 | | - class="rounded p-0.5 hover:bg-muted" |
412 | | - onclick={saveEditingName} |
413 | | - title="Save" |
414 | | - > |
415 | | - <Check class="h-4 w-4 text-green-600" /> |
416 | | - </button> |
417 | | - <button |
418 | | - class="rounded p-0.5 hover:bg-muted" |
419 | | - onclick={() => (editingUserId = null)} |
420 | | - title="Cancel" |
421 | | - > |
422 | | - <X class="h-4 w-4 text-muted-foreground" /> |
423 | | - </button> |
424 | | - {:else} |
425 | | - <span class="font-medium">{user.display_name}</span> |
426 | | - <button |
427 | | - class="rounded p-0.5 opacity-40 hover:bg-muted hover:opacity-100" |
428 | | - onclick={() => startEditingName(user)} |
429 | | - title="Edit display name" |
430 | | - > |
431 | | - <Pencil class="h-3.5 w-3.5" /> |
432 | | - </button> |
433 | | - {#if user.email} |
434 | | - <span class="text-sm text-muted-foreground">{user.email}</span> |
| 400 | + <div class="flex flex-col gap-1"> |
| 401 | + <div class="flex items-center gap-2"> |
| 402 | + {#if editingUserId === user.id} |
| 403 | + <input |
| 404 | + class="w-48 rounded-md border bg-background px-2 py-0.5 text-sm" |
| 405 | + bind:value={editingName} |
| 406 | + onkeydown={(e) => { |
| 407 | + if (e.key === 'Enter') saveEditingName(); |
| 408 | + if (e.key === 'Escape') editingUserId = null; |
| 409 | + }} |
| 410 | + /> |
| 411 | + <button |
| 412 | + class="rounded p-0.5 hover:bg-muted" |
| 413 | + onclick={saveEditingName} |
| 414 | + title="Save" |
| 415 | + > |
| 416 | + <Check class="h-4 w-4 text-green-600" /> |
| 417 | + </button> |
| 418 | + <button |
| 419 | + class="rounded p-0.5 hover:bg-muted" |
| 420 | + onclick={() => (editingUserId = null)} |
| 421 | + title="Cancel" |
| 422 | + > |
| 423 | + <X class="h-4 w-4 text-muted-foreground" /> |
| 424 | + </button> |
| 425 | + {:else} |
| 426 | + <span class="font-medium">{user.display_name}</span> |
| 427 | + <button |
| 428 | + class="rounded p-0.5 opacity-40 hover:bg-muted hover:opacity-100" |
| 429 | + onclick={() => startEditingName(user)} |
| 430 | + title="Edit display name" |
| 431 | + > |
| 432 | + <Pencil class="h-3.5 w-3.5" /> |
| 433 | + </button> |
435 | 434 | {/if} |
| 435 | + </div> |
| 436 | + {#if user.email} |
| 437 | + <span class="text-sm text-muted-foreground">{user.email}</span> |
436 | 438 | {/if} |
437 | 439 | </div> |
438 | 440 | <div class="flex items-center gap-2"> |
|
0 commit comments