TextInput.js 517 B

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