import React from 'react';
import { FormField, Input } from '@wix/design-system';
import { Field } from '../Field';
import { dataHooks } from '../dataHooks';
import { useTextInput } from '../useTextInput';
export const ShortText = ({ dataHook, schema, initialValue, onChange, }) => {
    const { value, charCount, handleChange } = useTextInput({
        initialValue,
        maxLength: schema.maxLength,
        onChange,
    });
    return (React.createElement(Field, { dataHook: dataHook, type: schema.type },
        React.createElement(FormField, { dataHook: dataHooks.Label, label: schema.label, charCount: charCount },
            React.createElement(Input, { dataHook: dataHooks.Input, value: value, onChange: handleChange }))));
};
//# sourceMappingURL=ShortText.js.map