48 lines
1022 B
React
48 lines
1022 B
React
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
|
||
|
|
className="border-custom-blue mt-2 bg-black"
|
||
|
|
type="text"
|
||
|
|
containerClassName="mr-2"
|
||
|
|
value={value}
|
||
|
|
onChange={event => {
|
||
|
|
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;
|