2020-03-27 16:28:36 -03:00
|
|
|
import React from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
|
|
import { Input, InputLabelWrapper } from '@ohif/ui';
|
|
|
|
|
|
|
|
|
|
const InputText = ({
|
|
|
|
|
label,
|
|
|
|
|
isSortable,
|
|
|
|
|
sortDirection,
|
|
|
|
|
onLabelClick,
|
|
|
|
|
value,
|
|
|
|
|
onChange,
|
|
|
|
|
}) => {
|
|
|
|
|
return (
|
|
|
|
|
<InputLabelWrapper
|
|
|
|
|
label={label}
|
|
|
|
|
isSortable={isSortable}
|
|
|
|
|
sortDirection={sortDirection}
|
|
|
|
|
onLabelClick={onLabelClick}
|
|
|
|
|
>
|
|
|
|
|
<Input
|
2020-04-02 15:52:41 -03:00
|
|
|
className="border-primary-main mt-2 bg-black"
|
2020-03-27 16:28:36 -03:00
|
|
|
type="text"
|
|
|
|
|
containerClassName="mr-2"
|
|
|
|
|
value={value}
|
2020-04-02 15:52:41 -03:00
|
|
|
onChange={(event) => {
|
2020-03-27 16:28:36 -03:00
|
|
|
onChange(event.target.value);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</InputLabelWrapper>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
InputText.defaultProps = {
|
|
|
|
|
value: '',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
InputText.propTypes = {
|
|
|
|
|
label: PropTypes.string.isRequired,
|
|
|
|
|
isSortable: PropTypes.bool.isRequired,
|
|
|
|
|
sortDirection: PropTypes.oneOf(['ascending', 'descending', 'none'])
|
|
|
|
|
.isRequired,
|
|
|
|
|
onLabelClick: PropTypes.func.isRequired,
|
|
|
|
|
value: PropTypes.string,
|
|
|
|
|
onChange: PropTypes.func.isRequired,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default InputText;
|