jobiqo-cl
Version:
[](https://circleci.com/gh/jobiqo/jobiqo-cl)
28 lines (25 loc) • 950 B
JavaScript
import React__default from 'react';
import { FormItem, FormLabel } from '../11-form-item/index.js';
import { Textarea as Textarea$1 } from './styles.js';
/**
* @file index.tsx
*
* @fileoverview Renders a textarea using the styles provided in the theme.
*/
/**
* A textarea form element. Should be used for long text form elements. For larger or smaller
* textareas make sure to manipulate the rows prop property.
*/
const Textarea = (props) => {
const { label, id, rows, columns } = props;
if (!label) {
return React__default.createElement(Textarea$1, Object.assign({ id: id }, rows, columns, props));
}
return (React__default.createElement(FormItem, null,
React__default.createElement(FormLabel, { htmlFor: id }, label),
React__default.createElement(Textarea$1, Object.assign({ id: id }, rows, columns, props))));
};
Textarea.defaultProps = {
rows: 10
};
export { Textarea };