{#if sharedHubsState.value == null} {:else} {#if !hasSharedShockers} {:else}
{#each sharedHubsState.value as owner (owner.id)} {@const totalShockers = owner.devices.reduce((acc, d) => acc + d.shockers.length, 0)}

{owner.name}

{m.shockers_count({ count: totalShockers })}

{#each owner.devices as device (device.id)} {@const hubOnline = onlineHubs.get(device.id)?.isOnline ?? false} {#each device.shockers as shocker (shocker.id)} {@const liveConn = getLiveConnection(device.id)} {@const liveState = liveConn?.getShockerState(shocker.id)} {@const isShockerLiveActive = (liveState?.isLive ?? false) && liveConn?.state === LiveConnectionState.Connected} {#snippet live()} {#if shocker.permissions.live} {/if} {/snippet} {#snippet menu()} {#snippet child({ props })} {/snippet} {m.shocker_label()} copyToClipboard(shocker.id, m.common_id_copied())} > {m.common_copy_id()} {/snippet} {#if isShockerLiveActive && liveState && liveConn} {:else} {/if} {/each} {/each}
{/each}
{/if} {/if}