/** * ds-frontpage.js * Front page component for team workdesks * Refactored: Shadow DOM, extracted styles, uses ds-metric-card */ import contextStore from '../../stores/context-store.js'; import './ds-metric-card.js'; // Import the new reusable component export default class Frontpage extends HTMLElement { constructor() { super(); this.attachShadow({ mode: 'open' }); // Enable Shadow DOM this.state = { teamName: 'Team', metrics: {} }; } connectedCallback() { this.render(); this.setupEventListeners(); // Subscribe to context changes this.unsubscribe = contextStore.subscribe(({ state }) => { this.state.teamId = state.teamId; const teamNames = { 'ui': 'UI Team', 'ux': 'UX Team', 'qa': 'QA Team', 'admin': 'Admin' }; this.state.teamName = teamNames[state.teamId] || 'Team'; this.updateTeamName(); }); } disconnectedCallback() { if (this.unsubscribe) this.unsubscribe(); } render() { this.shadowRoot.innerHTML = `
Overview of design system adoption and metrics for your team