2021-04-02 04:16:26 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
|
2021-04-10 03:49:07 +00:00
|
|
|
export const TextInput = function TextInput({ id, width, height, component, onComponentClick, currentState, onComponentOptionChanged }) {
|
2021-04-04 13:11:17 +00:00
|
|
|
|
|
|
|
|
console.log('currentState', currentState);
|
|
|
|
|
|
|
|
|
|
const placeholder = component.definition.properties.placeholder.value;
|
|
|
|
|
|
2021-04-02 04:16:26 +00:00
|
|
|
return (
|
2021-04-04 13:11:17 +00:00
|
|
|
<input
|
|
|
|
|
onClick={() => onComponentClick(id, component) }
|
|
|
|
|
onChange={(e) => onComponentOptionChanged(component, 'value', e.target.value)}
|
|
|
|
|
type="text"
|
|
|
|
|
class="form-control"
|
|
|
|
|
placeholder={placeholder}
|
2021-04-10 03:49:07 +00:00
|
|
|
style={{width, height}}
|
2021-04-04 13:11:17 +00:00
|
|
|
/>
|
2021-04-02 04:16:26 +00:00
|
|
|
);
|
|
|
|
|
};
|