<commit_before>/*

Layout for a single form item

*/

import React from 'react';
import Form from 'react-bootstrap/Form';
import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
import { registerComponent } from 'meteor/vulcan:core';

const FormItem = ({ path, label, children, beforeInput, afterInput, ...rest }) => {
  if (label) {
    return (
      <Form.Group as={Row} controlId={path} {...rest}>
        <Form.Label column sm={3}>
          {label}
        </Form.Label>
        <Col sm={9}>
          {beforeInput}
          {children}
          {afterInput}
        </Col>
      </Form.Group>
    );
  } else {
    return (
      <Form.Group controlId={path} {...rest}>
        {beforeInput}
        {children}
        {afterInput}
      </Form.Group>
    );
  }
};

registerComponent('FormItem', FormItem);<commit_msg>Add layout prop for Formitem<commit_after>/*

Layout for a single form item

*/

import React from 'react';
import Form from 'react-bootstrap/Form';
import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
import { registerComponent } from 'meteor/vulcan:core';

const FormItem = ({ path, label, children, beforeInput, afterInput, layout = 'horizontal', ...rest }) => {
  if (layout === 'inputOnly' || !label) { // input only layout
    return (
      <Form.Group controlId={path} {...rest}>
        {beforeInput}
        {children}
        {afterInput}
      </Form.Group>
    );
  } else if (layout === 'vertical') { // vertical layout
    return <div>TODO</div>;
  } else { // horizontal layout (default)
    return (
      <Form.Group as={Row} controlId={path} {...rest}>
        <Form.Label column sm={3}>
          {label}
        </Form.Label>
        <Col sm={9}>
          {beforeInput}
          {children}
          {afterInput}
        </Col>
      </Form.Group>
    );
  }
};

registerComponent('FormItem', FormItem);
{'fraction_non_alphanumeric': 0.15842105263157893, 'fraction_numerical': 0.002105263157894737, 'mean_word_length': 2.4129263913824057, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '373396', 'n_tokens_mistral': 581, 'n_tokens_neox': 578, 'n_words': 151}