Youtube music and video downloader

Link.jsx 958B

123456789101112131415161718192021222324252627
  1. import React from 'react';
  2. import { createContainer } from 'meteor/react-meteor-data';
  3. import { Converted } from '../api/links';
  4. import Options from './Options';
  5. import Video from './Video';
  6. const Link = ({ link, remove, options, converted }) =>
  7. <li className="link">
  8. <span className="link-text" title={link.title}>{link.title}</span>
  9. <Options className="link-options" handlers={options} video={link} converted={converted}/>
  10. <button className="link-delete" onClick={remove}>&times;</button>
  11. </li>;
  12. Link.propTypes = {
  13. link: React.PropTypes.instanceOf(Video).isRequired,
  14. remove: React.PropTypes.func.isRequired,
  15. options: React.PropTypes.arrayOf(React.PropTypes.shape({
  16. type: React.PropTypes.string,
  17. handler: React.PropTypes.func
  18. })).isRequired,
  19. converted: React.PropTypes.object
  20. };
  21. export default createContainer(({ link, converted_id, remove, options }) => ({
  22. converted: Converted.findOne(converted_id),
  23. link, remove, options,
  24. }), Link);