import React from 'react';
import SearchInput from '../../components/SearchInput';
import './index.less';

export default function TreeTitle({ title, inputPlaceholder, onChange, hasInput = true, titleExt }) {
  if (!title) {
    return null;
  }
  return (
    <div className="lm-c-tree-title-part">
      <span className={'title-text'}>{title}</span>
      {hasInput && <SearchInput className="input-keword" placeholder={inputPlaceholder} onChange={onChange} />}
      {titleExt}
    </div>
  );
}
