Files
ohif-viewer/platform/ui/src/components/InputText/InputText.jsx
T

50 lines
1.0 KiB
React
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
2020-08-14 15:25:08 -03:00
import { Input, InputLabelWrapper } from '../';
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"
type="text"
containerClassName="mr-2"
value={value}
2020-06-26 12:34:43 -03:00
onChange={event => {
onChange(event.target.value);
}}
/>
</InputLabelWrapper>
);
};
InputText.defaultProps = {
value: '',
2020-06-26 12:34:43 -03:00
isSortable: false,
onLabelClick: () => {},
sortDirection: 'none',
};
InputText.propTypes = {
label: PropTypes.string.isRequired,
2020-06-26 12:34:43 -03:00
isSortable: PropTypes.bool,
sortDirection: PropTypes.oneOf(['ascending', 'descending', 'none']),
onLabelClick: PropTypes.func,
value: PropTypes.any,
onChange: PropTypes.func.isRequired,
};
export default InputText;