| Sean McCullough | 71941bd | 2025-04-18 13:31:48 -0700 | [diff] [blame] | 1 | import { css, html, LitElement } from "lit"; |
| 2 | import { customElement, property } from "lit/decorators.js"; |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 3 | |
| Sean McCullough | 71941bd | 2025-04-18 13:31:48 -0700 | [diff] [blame] | 4 | @customElement("sketch-network-status") |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 5 | export class SketchNetworkStatus extends LitElement { |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 6 | @property() |
| 7 | connection: string; |
| Sean McCullough | b29f891 | 2025-04-20 15:39:11 -0700 | [diff] [blame] | 8 | |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 9 | @property() |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 10 | error: string; |
| Sean McCullough | 71941bd | 2025-04-18 13:31:48 -0700 | [diff] [blame] | 11 | |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 12 | // See https://lit.dev/docs/components/styles/ for how lit-element handles CSS. |
| 13 | // Note that these styles only apply to the scope of this web component's |
| 14 | // shadow DOM node, so they won't leak out or collide with CSS declared in |
| 15 | // other components or the containing web page (...unless you want it to do that). |
| 16 | |
| 17 | static styles = css` |
| Sean McCullough | 71941bd | 2025-04-18 13:31:48 -0700 | [diff] [blame] | 18 | .status-container { |
| Philip Zeyliger | 5e35702 | 2025-05-16 04:50:34 +0000 | [diff] [blame] | 19 | display: none; /* Hide by default - we're removing the dot */ |
| Sean McCullough | 71941bd | 2025-04-18 13:31:48 -0700 | [diff] [blame] | 20 | } |
| 21 | `; |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 22 | |
| 23 | constructor() { |
| 24 | super(); |
| 25 | } |
| 26 | |
| 27 | // See https://lit.dev/docs/components/lifecycle/ |
| 28 | connectedCallback() { |
| 29 | super.connectedCallback(); |
| 30 | } |
| 31 | |
| 32 | // See https://lit.dev/docs/components/lifecycle/ |
| 33 | disconnectedCallback() { |
| Sean McCullough | 71941bd | 2025-04-18 13:31:48 -0700 | [diff] [blame] | 34 | super.disconnectedCallback(); |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 35 | } |
| 36 | |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 37 | render() { |
| Philip Zeyliger | 5e35702 | 2025-05-16 04:50:34 +0000 | [diff] [blame] | 38 | // We no longer show any content as the dot is being removed |
| 39 | // The connection status will now be handled by the call-status component |
| Autoformatter | 8c46362 | 2025-05-16 21:54:17 +0000 | [diff] [blame] | 40 | return html` <div class="status-container"></div> `; |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 41 | } |
| 42 | } |
| 43 | |
| 44 | declare global { |
| 45 | interface HTMLElementTagNameMap { |
| 46 | "sketch-network-status": SketchNetworkStatus; |
| 47 | } |
| Sean McCullough | 71941bd | 2025-04-18 13:31:48 -0700 | [diff] [blame] | 48 | } |