import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import MediaQuery from 'react-responsive'; import { gettext, lang } from '../../utils/constants'; import { Button, Col, Collapse, CustomInput, FormGroup, Input, Label, Row, InputGroupAddon, InputGroup } from 'reactstrap'; import SelectDate from '@seafile/seafile-editor/dist/components/calander'; const { repo_name, search_repo } = window.search.pageOptions; class AdvancedSearch extends React.Component { constructor(props) { super(props); } getFileTypesList = (fileTypes) => { const fileTypeItems = [gettext('Text'), gettext('Document'), gettext('Image'), gettext('Video'), gettext('Audio'), 'PDF', 'Markdown']; let ftype = []; for (let i = 0, len = fileTypes.length; i < len; i++) { if (fileTypes[i]) { ftype.push(fileTypeItems[i]); } } return ftype; }; render() { const { stateAndValues } = this.props; const { errorDateMsg, errorSizeMsg } = stateAndValues; if (stateAndValues.isShowSearchFilter) { const { size_from, size_to, time_from, time_to, search_repo, fileTypeItemsStatus } = stateAndValues; const fileTypes = this.getFileTypesList(fileTypeItemsStatus); const typesLength = fileTypes.length; return (