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

48 lines
1.0 KiB
React
Raw Normal View History

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"
type="text"
containerClassName="mr-2"
value={value}
2020-04-02 15:52:41 -03:00
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;