ToolJet/frontend/src/Editor/Components/TextInput.jsx

27 lines
586 B
React
Raw Normal View History

import React from 'react';
2021-04-30 06:31:32 +00:00
export const TextInput = function TextInput({
id,
width,
height,
component,
onComponentClick,
currentState,
onComponentOptionChanged,
}) {
console.log('currentState', currentState);
2021-04-30 06:31:32 +00:00
const placeholder = component.definition.properties.placeholder.value;
2021-04-30 06:31:32 +00:00
return (
<input
onClick={() => onComponentClick(id, component)}
onChange={(e) => onComponentOptionChanged(component, 'value', e.target.value)}
type="text"
class="form-control"
placeholder={placeholder}
style={{ width, height }}
/>
);
};