zulip/components/page-home.js

45 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2026-03-04 11:13:15 -08:00
// components/page-home.js
import { LitElement, html, css } from 'lit'
class PageHome extends LitElement {
2026-03-04 14:18:44 -08:00
static properties = {
user: { type: Object },
items: { type: Array }
}
2026-03-04 11:13:15 -08:00
static styles = css`
:host { display: block; padding: 2rem 1.5rem; }
h1 { font-size: 1.5rem; margin: 0 0 0.5rem; }
p { color: #64748b; margin: 0 0 2rem; }
.summary {
display: flex;
gap: 1rem;
}
.stat {
padding: 1rem 1.5rem;
border: 1px solid #e2e8f0;
border-radius: 8px;
}
.stat-value { font-size: 2rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: #94a3b8; margin-top: 0.25rem; }
`
render() {
2026-03-04 14:18:44 -08:00
const name = this.user?.name ?? 'there'
const count = this.items?.length ?? 0
2026-03-04 11:13:15 -08:00
return html`
<h1>Hey, ${name}</h1>
<p>Here's what's going on.</p>
<div class="summary">
<div class="stat">
<div class="stat-value">${count}</div>
<div class="stat-label">Items</div>
</div>
</div>
`
}
}
2026-03-04 14:18:44 -08:00
customElements.define('page-home', PageHome)