TextInput.js 532 B

12345678910111213141516171819202122232425262728
  1. import { Input, Typography } from '@douyinfe/semi-ui';
  2. import React from 'react';
  3. const TextInput = ({
  4. label,
  5. name,
  6. value,
  7. onChange,
  8. placeholder,
  9. type = 'text',
  10. }) => {
  11. return (
  12. <>
  13. <div style={{ marginTop: 10 }}>
  14. <Typography.Text strong>{label}</Typography.Text>
  15. </div>
  16. <Input
  17. name={name}
  18. placeholder={placeholder}
  19. onChange={(value) => onChange(value)}
  20. value={value}
  21. autoComplete='new-password'
  22. />
  23. </>
  24. );
  25. };
  26. export default TextInput;