blob: 1f8b01ac7de188dac8deb8697e9929d2ab7f9d19 [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001// Copyright 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import {LitElement, html} from 'lit-element';
6import {SHARED_STYLES} from 'shared/shared-styles.js';
7
8/**
9 * `<mr-hotlist-link>`
10 *
11 * Displays a link to a hotlist.
12 *
13 */
14export class MrHotlistLink extends LitElement {
15 /** @override */
16 static get styles() {
17 return SHARED_STYLES;
18 }
19
20 /** @override */
21 render() {
22 if (!this.hotlist) return html``;
23 return html`
24 <a
25 href="/u/${this.hotlist.ownerRef && this.hotlist.ownerRef.userId}/hotlists/${this.hotlist.name}"
26 title="${this.hotlist.name} - ${this.hotlist.summary}"
27 >
28 ${this.hotlist.name}</a>
29 `;
30 }
31
32 /** @override */
33 static get properties() {
34 return {
35 hotlist: {type: Object},
36 };
37 }
38}
39customElements.define('mr-hotlist-link', MrHotlistLink);