@@ -11,6 +11,7 @@
1111 import ShipLink from './ShipLink.svelte';
1212 import EthAddressLink from './EthAddressLink.svelte';
1313 import CollapsibleContent from './CollapsibleContent.svelte';
14+ import ShipListing from './ShipListing.svelte';
1415
1516 export let patp: string;
1617
@@ -18,6 +19,9 @@
1819 let rawPointInfoPromise: any;
1920 let rawPointInfo: any = {};
2021 let pointInfo: any = {};
22+ let rawSpawnedPointsPromise: any;
23+ let rawSpawnedPoints: any = {};
24+ let spawnedPoints: string[] = [];
2125 const api: UrbitApi = new UrbitApi('');
2226 const spawnStatusOptions = {
2327 unspawned: {
@@ -55,6 +59,7 @@
5559 $: shipClass = clan(patp);
5660 $: azPoint = ['galaxy', 'star', 'planet'].includes(shipClass);
5761 $: canSpawnPoints = ['galaxy', 'star'].includes(shipClass);
62+ $: spawnableClassPlural = !canSpawnPoints ? '' : (shipClass === 'galaxy' ? 'Stars' : 'Planets');
5863 $: {
5964 let parents = [patp];
6065 let galaxyFound = false;
@@ -85,6 +90,23 @@
8590 });
8691 }
8792 }
93+ $: {
94+ rawSpawnedPoints = {};
95+ if (canSpawnPoints) {
96+ rawSpawnedPointsPromise = api.scry<any>({ app: 'astrolabe', path: `/spawned/${patp}` });
97+ rawSpawnedPointsPromise.then((info) => {
98+ rawSpawnedPoints = info;
99+ }).catch((error) => {
100+ rawSpawnedPoints.error = error;
101+ });
102+ }
103+ }
104+ $: {
105+ spawnedPoints = [];
106+ if (rawSpawnedPoints.spawned) {
107+ spawnedPoints = rawSpawnedPoints.spawned.map(patp => normalizeId(patp));
108+ }
109+ }
88110 $: {
89111 pointInfo = {};
90112 let spawnStatus: any,
@@ -290,9 +312,24 @@
290312 </div>
291313 </div>
292314 {#if canSpawnPoints}
293− <div>
294− <h3 class="text-lg">Spawned Points: {pointInfo.spawnedCount || ''}</h3>
295− <span class="text-green-600">// TODO</span>
315+ <div class="mt-5 p-3 border-t">
316+ {#await rawPointInfoPromise then}
317+ <h3 class="text-lg">
318+ {#if pointInfo.spawnedCount}
319+ {pointInfo.spawnedCount} Spawned {spawnableClassPlural}:
320+ {:else}
321+ No Spawned {spawnableClassPlural}
322+ {/if}
323+ </h3>
324+ {/await}
325+ {#await rawSpawnedPointsPromise}
326+ Loading {spawnableClassPlural}...
327+ {:then}
328+ <!-- TODO: pagination -->
329+ {#each spawnedPoints as patp, i}
330+ <ShipListing ship={{ patp }} linkToShip />
331+ {/each}
332+ {/await}
296333 </div>
297334 {/if}
298335</div>