/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ import React, { Component } from "react"; import PropTypes from "prop-types"; import { connect } from "../../utils/connect"; import { getAllThreads } from "../../selectors"; import Thread from "./Thread"; import "./Threads.css"; export class Threads extends Component { static get propTypes() { return { threads: PropTypes.array.isRequired, }; } render() { const { threads } = this.props; return (
{threads.map(thread => ( ))}
); } } const mapStateToProps = state => ({ threads: getAllThreads(state), }); export default connect(mapStateToProps)(Threads);