'use strict'; import React from 'react'; import { Link } from 'react-router'; import { getLangText } from '../../utils/lang_utils'; let AccordionList = React.createClass({ propTypes: { children: React.PropTypes.arrayOf(React.PropTypes.element).isRequired, loadingElement: React.PropTypes.element.isRequired, className: React.PropTypes.string, count: React.PropTypes.number, itemList: React.PropTypes.arrayOf(React.PropTypes.object), search: React.PropTypes.string, searchFor: React.PropTypes.func }, clearSearch() { this.props.searchFor(''); }, render() { const { search } = this.props; if (this.props.itemList && this.props.itemList.length > 0) { return (
{this.props.children}
); } else if(this.props.count === 0 && !search) { return (

{getLangText('We could not find any works related to you...')}

{getLangText('To register one, click')}  {getLangText('here')}!

); } else if(this.props.count === 0 && search) { return (

{getLangText('We could not find any works related to you...')}

{getLangText('You\'re filtering by the search keyword: \'%s\' ', search)}

); } else { return (
{this.props.loadingElement}
); } } }); export default AccordionList;