import pluralize from 'pluralize';
import React from 'react';
import { BaseTextPropertyWidget } from './TextPropertyWidget';
import { InputAdornment } from '@material-ui/core';
/**
 * `float` property widget
 *
 * Outputs a type=number TextField with an optional unit and an optional step
 */
const FloatPropertyWidget = props => {
    const { property } = props;
    const { unit, step } = property;
    let endAdornment;
    if (unit) {
        endAdornment = (React.createElement(InputAdornment, { position: "end" }, pluralize(unit)));
    }
    return (React.createElement(BaseTextPropertyWidget, Object.assign({ type: "number", inputProps: {
            step: step ? step : 1,
        }, InputProps: { endAdornment } }, props)));
};
export default FloatPropertyWidget;
//# sourceMappingURL=FloatPropertyWidget.js.map