{#if item}
{#snippet children()} {#key item?.id ?? position}
ctx?.canEdit() && replace()} >
{#if ctx?.canEdit() && item?.id}
{ e.stopPropagation(); remove() }}>×
{/if} {#if item?.main || position === -1}
Main
{/if} {#if item?.friend || position === 6}
Friend
{/if}
{/key} {/snippet} {#snippet menu()}
View Details
{#if ctx?.canEdit()}
Replace
Remove
{/if} {/snippet}
{:else} {#key `empty-${position}`}
ctx?.canEdit() && ctx?.openPicker && ctx.openPicker({ type: 'summon', position, item })} >
{#if ctx?.canEdit()}
{/if}
{/key} {/if} {#if item}
{ if (!item?.id || !ctx) return try { const editKey = ctx.getEditKey() const updated = await ctx.services.gridService.updateSummonUncap(item.id, level, undefined, editKey || undefined) if (updated) { ctx.updateParty(updated) } } catch (err) { console.error('Failed to update summon uncap:', err) // TODO: Show user-friendly error notification } }} updateTranscendence={async (stage) => { if (!item?.id || !ctx) return try { const editKey = ctx.getEditKey() // When setting transcendence > 0, also set uncap to max (6) const maxUncap = stage > 0 ? 6 : undefined const updated = await ctx.services.gridService.updateSummonUncap(item.id, maxUncap, stage, editKey || undefined) if (updated) { ctx.updateParty(updated) } } catch (err) { console.error('Failed to update summon transcendence:', err) // TODO: Show user-friendly error notification } }} /> {/if}
{item ? displayName(item?.summon) : ''}