diff --git a/src/lib/components/party/Party.svelte b/src/lib/components/party/Party.svelte index d6b1f532..1e9696da 100644 --- a/src/lib/components/party/Party.svelte +++ b/src/lib/components/party/Party.svelte @@ -36,7 +36,6 @@ // Utilities import { getLocalId } from '$lib/utils/localId' import { getEditKey, storeEditKey, computeEditability } from '$lib/utils/editKeys' - import { getAvatarSrc, getAvatarSrcSet } from '$lib/utils/avatar' import { createDragDropContext, type DragOperation } from '$lib/composables/drag-drop.svelte' import WeaponGrid from '$lib/components/grids/WeaponGrid.svelte' @@ -888,41 +887,13 @@
-
-
-

{party.name || '(untitled party)'}

- {#if party.user} - {@const avatarSrc = getAvatarSrc(party.user.avatar?.picture)} - {@const avatarSrcSet = getAvatarSrcSet(party.user.avatar?.picture)} - - {/if} -
- -
- {#if canEdit()} - - {/if} - + + {#snippet menu()} @@ -962,15 +933,8 @@ -
-
- - + {/snippet} + - import InfoTile from './InfoTile.svelte' + import type { Snippet } from 'svelte' import DescriptionRenderer from '$lib/components/DescriptionRenderer.svelte' + import Button from '$lib/components/ui/Button.svelte' + import Icon from '$lib/components/Icon.svelte' + import { getAvatarSrc, getAvatarSrcSet } from '$lib/utils/avatar' interface Props { + name?: string description?: string - onOpen: () => void + user?: { + username?: string + avatar?: { + picture?: string | null + element?: string | null + } | null + } | null + canEdit?: boolean + onOpenDescription: () => void + onOpenEdit?: () => void + /** Slot for the dropdown menu */ + menu?: Snippet } - let { description, onOpen }: Props = $props() + let { name, description, user, canEdit = false, onOpenDescription, onOpenEdit, menu }: Props = + $props() + + const avatarSrc = $derived(getAvatarSrc(user?.avatar?.picture)) + const avatarSrcSet = $derived(getAvatarSrcSet(user?.avatar?.picture)) - - {#if description} - - {:else} - No description +
+ +
+

{name || '(untitled party)'}

+
+ {#if canEdit} + + {/if} + {#if menu} + {@render menu()} + {/if} +
+
+ + + {#if user} + +
+ {#if user.avatar?.picture} + {`Avatar + {:else} + + {/if} +
+ {user.username} +
{/if} - + + + +