diff --git a/src/components/cc-zone/cc-zone.js b/src/components/cc-zone/cc-zone.js index 2f040a709..bc0f0670b 100644 --- a/src/components/cc-zone/cc-zone.js +++ b/src/components/cc-zone/cc-zone.js @@ -10,6 +10,9 @@ import { skeletonStyles } from '../../styles/skeleton.js'; const SKELETON_ZONE = { name: 'name', country: '????????????', + countryCode: null, + lon: 0, + lat: 0, city: '??????????', tags: ['????????', '????????????'], }; @@ -17,6 +20,8 @@ const SKELETON_ZONE = { const PRIVATE_ZONE = 'scope:private'; /** + * @typedef {import('./cc-zone.types.js').ZoneState} ZoneState + * @typedef {import('./cc-zone.types.js').ZoneStateLoaded} ZoneStateLoaded * @typedef {import('./cc-zone.types.js').ZoneModeType} ZoneModeType * @typedef {import('../common.types.js').Zone} Zone */ @@ -26,7 +31,6 @@ const PRIVATE_ZONE = 'scope:private'; * * ## Details * - * * When `zone` is nullish, a skeleton screen UI pattern is displayed (loading hint). * * When a tag prefixed with `infra:` is used, the corresponding logo is displayed. * * When the `scope:private` tag is used, the optional `displayName` of the zone will be used instead of the City + Country. * * If the browser supports it, the `countryCode` will be used to display a translated version of the country's name. @@ -47,7 +51,7 @@ export class CcZone extends LitElement { static get properties () { return { mode: { type: String, reflect: true }, - zone: { type: Object }, + state: { type: Object }, }; } @@ -57,12 +61,16 @@ export class CcZone extends LitElement { /** @type {ZoneModeType} Sets the mode of the component. */ this.mode = 'default'; - /** @type {Zone|null} Sets the different details of the zone. */ - this.zone = null; + /** @type {ZoneState} Sets the state of the component. */ + this.state = { type: 'loading' }; } // This is a bit irregular to do this but we need to reuse this text logic in a