/* * Copyright (c) 2016 Gabriel Augendre * Free software under MIT License. See LICENSE file. */ 'use strict'; var React = require('react'); var ReactBootstrap = require('react-bootstrap'); var PlaylistBox = React.createClass({ getInitialState: function () { return { currentId: null }; }, clickOnItem: function (id, uid, event) { event.preventDefault(); if (!this.props.dupsLoading) { this.setState({currentId: id}); this.props.handleClick(id, uid); } }, render: function () { var ListGroup = ReactBootstrap.ListGroup, ListGroupItem = ReactBootstrap.ListGroupItem; var currentId = this.state.currentId; var playlists =

No playlist found.

; if (this.props.playlists) { playlists = this.props.playlists.map(function (pl) { var id = pl.id; var active = currentId == id; var classes = this.props.dupsLoading ? "disabled" : ""; return ( {pl.name} ); }, this); } return ( {playlists} ); } }); module.exports = PlaylistBox;