2021-04-27 14:21:18 +00:00
|
|
|
import React from "react"
|
|
|
|
import Style from "./TextArea.module.css"
|
|
|
|
import classNames from "classnames"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A multiline text field which can optionally be resized.
|
|
|
|
*
|
|
|
|
* @param resize - `true` if the resizing the textarea should be allowed, `false` otherwise.
|
|
|
|
* @param children - The value of the `<textarea>`.
|
|
|
|
* @param className - Additional class(es) to add to the textarea.
|
|
|
|
* @param props - Additional props to pass to the textarea.
|
|
|
|
* @returns {JSX.Element}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
export default function TextArea({ resize, children, className, ...props }) {
|
|
|
|
return (
|
2021-05-11 14:37:15 +00:00
|
|
|
<textarea
|
|
|
|
className={classNames(Style.TextArea, resize
|
|
|
|
? Style.TextAreaResizable
|
|
|
|
: Style.TextAreaNoResize, className)} {...props}>
|
2021-04-27 14:21:18 +00:00
|
|
|
{children}
|
|
|
|
</textarea>
|
|
|
|
)
|
|
|
|
}
|