1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5import React from "react";
6
7export class Topic extends React.PureComponent {
8  render() {
9    const { url, name } = this.props;
10    return (
11      <li>
12        <a key={name} href={url}>
13          {name}
14        </a>
15      </li>
16    );
17  }
18}
19
20export class Topics extends React.PureComponent {
21  render() {
22    const { topics } = this.props;
23    return (
24      <span className="topics">
25        <span data-l10n-id="newtab-pocket-read-more" />
26        <ul>
27          {topics &&
28            topics.map(t => <Topic key={t.name} url={t.url} name={t.name} />)}
29        </ul>
30      </span>
31    );
32  }
33}
34