import React from 'react'

import css from './panel.scss'

class Panel extends React.Component {
  constructor(props) {
    super(props);
    this.state = {}
  }


  render() {
    const {lang} = this.props
    const {children, title, onMore, moreText = lang.showAll, className, isLast, addTitle, isFixed} = this.props
    return (
      <div className={`${css['ks-panel']} ${className}`}>
        <div className={css.top}>
          <span className={`${css.title} ${isFixed ? css.isFixed : ""}`}>{title}</span>
          {/*通讯录的为了安全起见返回最多50条数据*/}
          {addTitle ? <span className="s-primary">{addTitle}</span> : null}
          {onMore ? <span className={`${css.more} s-primary`} onClick={onMore}>{moreText} ></span> : null}
        </div>
        {children}
        {isLast ? null : <i className={`${css.bottom} s-b-default`}/>}
      </div>
    )
  }


}

export default Panel;