UNPKG

@brizy/ui

Version:
13 lines (12 loc) 609 B
import React, { useCallback } from "react"; import { isNumber } from "../../utils"; import { BRZ_PREFIX } from "../../constants"; export const ToolbarTextarea = ({ height, placeholder, value, onChange }) => { const _onChange = useCallback((e) => { onChange(e.target.value); }, [onChange]); const styles = { [`--${BRZ_PREFIX}-toolbar--textarea-height`]: isNumber(height) ? `${height}px` : undefined, }; return (React.createElement("textarea", { className: `${BRZ_PREFIX}-toolbar__textarea`, style: styles, placeholder: placeholder, value: value, onChange: _onChange })); };