| 123456789101112131415161718192021222324252627 |
- import React from 'react';
- import { createContainer } from 'meteor/react-meteor-data';
- import { Converted } from '../api/links';
- import Options from './Options';
- import Video from './Video';
-
- const Link = ({ link, remove, options, converted }) =>
- <li className="link">
- <span className="link-text" title={link.title}>{link.title}</span>
- <Options className="link-options" handlers={options} video={link} converted={converted}/>
- <button className="link-delete" onClick={remove}>×</button>
- </li>;
-
- Link.propTypes = {
- link: React.PropTypes.instanceOf(Video).isRequired,
- remove: React.PropTypes.func.isRequired,
- options: React.PropTypes.arrayOf(React.PropTypes.shape({
- type: React.PropTypes.string,
- handler: React.PropTypes.func
- })).isRequired,
- converted: React.PropTypes.object
- };
-
- export default createContainer(({ link, converted_id, remove, options }) => ({
- converted: Converted.findOne(converted_id),
- link, remove, options,
- }), Link);
|