import { DeesElement, customElement, html, css, cssManager, property, type TemplateResult, } from '@design.estate/dees-element'; declare global { interface HTMLElementTagNameMap { 'sz-platform-services-card': SzPlatformServicesCard; } } export interface IPlatformService { name: string; status: string; running: boolean; url?: string; } @customElement('sz-platform-services-card') export class SzPlatformServicesCard extends DeesElement { public static demo = () => html`
`; public static demoGroups = ['Platform']; @property({ type: Array }) public accessor services: IPlatformService[] = []; public static styles = [ cssManager.defaultStyles, css` :host { display: block; height: 100%; } .card { background: ${cssManager.bdTheme('#ffffff', '#09090b')}; border: 1px solid ${cssManager.bdTheme('#e4e4e7', '#27272a')}; border-radius: 8px; padding: 20px; height: 100%; box-sizing: border-box; } .header { margin-bottom: 16px; } .title { font-size: 16px; font-weight: 600; color: ${cssManager.bdTheme('#18181b', '#fafafa')}; } .subtitle { font-size: 13px; color: ${cssManager.bdTheme('#71717a', '#a1a1aa')}; margin-top: 2px; } .services-list { display: flex; flex-direction: column; gap: 12px; } .service-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; cursor: pointer; transition: opacity 200ms ease; } .service-item:hover { opacity: 0.8; } .service-left { display: flex; align-items: center; gap: 10px; } .status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; } .status-dot.running { background: ${cssManager.bdTheme('#22c55e', '#22c55e')}; box-shadow: 0 0 6px ${cssManager.bdTheme('rgba(34, 197, 94, 0.4)', 'rgba(34, 197, 94, 0.4)')}; } .status-dot.stopped { background: ${cssManager.bdTheme('#ef4444', '#ef4444')}; } .service-name { font-size: 14px; font-weight: 500; color: ${cssManager.bdTheme('#18181b', '#fafafa')}; } .service-status { font-size: 13px; color: ${cssManager.bdTheme('#71717a', '#a1a1aa')}; } `, ]; public render(): TemplateResult { return html`
Platform Services
Infrastructure status
${this.services.map( (service) => html`
this.handleServiceClick(service)}>
${service.name}
${service.status}
` )}
`; } private handleServiceClick(service: IPlatformService) { this.dispatchEvent( new CustomEvent('service-click', { detail: service, bubbles: true, composed: true, }) ); } }