@@ -11,6 +11,7 @@
11 import ShipLink from './ShipLink.svelte';
11 import ShipLink from './ShipLink.svelte';
12 import EthAddressLink from './EthAddressLink.svelte';
12 import EthAddressLink from './EthAddressLink.svelte';
13 import CollapsibleContent from './CollapsibleContent.svelte';
13 import CollapsibleContent from './CollapsibleContent.svelte';
14+ import ShipListing from './ShipListing.svelte';
15 export let patp: string;
16 export let patp: string;
@@ -18,6 +19,9 @@
18 let rawPointInfoPromise: any;
19 let rawPointInfoPromise: any;
19 let rawPointInfo: any = {};
20 let rawPointInfo: any = {};
20 let pointInfo: any = {};
21 let pointInfo: any = {};
22+ let rawSpawnedPointsPromise: any;
23+ let rawSpawnedPoints: any = {};
24+ let spawnedPoints: string[] = [];
21 const api: UrbitApi = new UrbitApi('');
25 const api: UrbitApi = new UrbitApi('');
22 const spawnStatusOptions = {
26 const spawnStatusOptions = {
23 unspawned: {
27 unspawned: {
@@ -55,6 +59,7 @@
55 $: shipClass = clan(patp);
59 $: shipClass = clan(patp);
56 $: azPoint = ['galaxy', 'star', 'planet'].includes(shipClass);
60 $: azPoint = ['galaxy', 'star', 'planet'].includes(shipClass);
57 $: canSpawnPoints = ['galaxy', 'star'].includes(shipClass);
61 $: canSpawnPoints = ['galaxy', 'star'].includes(shipClass);
62+ $: spawnableClassPlural = !canSpawnPoints ? '' : (shipClass === 'galaxy' ? 'Stars' : 'Planets');
59 let parents = [patp];
64 let parents = [patp];
60 let galaxyFound = false;
65 let galaxyFound = false;
@@ -85,6 +90,23 @@
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;
106+ if (rawSpawnedPoints.spawned) {
107+ spawnedPoints = rawSpawnedPoints.spawned.map(patp => normalizeId(patp));
89 pointInfo = {};
111 pointInfo = {};
90 let spawnStatus: any,
112 let spawnStatus: any,
@@ -290,9 +312,24 @@
292 {#if canSpawnPoints}
314 {#if canSpawnPoints}
293− <div>
315+ <div class="mt-5 p-3 border-t">
316+ {#await rawPointInfoPromise then}
317+ <h3 class="text-lg">
318+ {#if pointInfo.spawnedCount}
294− <h3 class="text-lg">Spawned Points: {pointInfo.spawnedCount || ''}</h3>
319+ {pointInfo.spawnedCount} Spawned {spawnableClassPlural}:
295− <span class="text-green-600">// TODO</span>
320+ {:else}
321+ No Spawned {spawnableClassPlural}
325+ {#await rawSpawnedPointsPromise}
326+ Loading {spawnableClassPlural}...
328+ <!-- TODO: pagination -->
329+ {#each spawnedPoints as patp, i}
330+ <ShipListing ship={{ patp }} linkToShip />