<commit_before>import { Checkbox, Form, Input, Radio, Select } from "antd";
import React from "react";
import { isTruthy } from "../../utilities/form-utilities";

/**
 * React component to render an input that has pre-defined options.
 * @param item
 * @returns {JSX.Element}
 * @constructor
 */
export function InputWithOptions({ item }) {
  if (item.options.length === 1) {
    return (
      <Form.Item name={item.name} label={item.label}>
        <Input type="text" value={item.options[0].value} disabled />
      </Form.Item>
    );
  } else if (isTruthy(item.options)) {
    return (
      <Form.Item name={item.name} valuePropName="checked">
        <Checkbox>{item.label}</Checkbox>
      </Form.Item>
    );
  } else if (item.options.length < 6) {
    return (
      <Form.Item name={item.name} label={item.label}>
        <Radio.Group options={item.options} />
      </Form.Item>
    );
  }
  return (
    <Form.Item name={item.name} label={item.label}>
      <Select>
        {item.options.map((option) => (
          <Select.Option key={option.value} value={option.value}>
            {option.label}
          </Select.Option>
        ))}
      </Select>
    </Form.Item>
  );
}
<commit_msg>Just display a radio input with one option<commit_after>import { Checkbox, Form, Radio, Select } from "antd";
import React from "react";
import { isTruthy } from "../../utilities/form-utilities";

/**
 * React component to render an input that has pre-defined options.
 * @param item
 * @returns {JSX.Element}
 * @constructor
 */
export function InputWithOptions({ item }) {
   if (isTruthy(item.options)) {
     return (
       <Form.Item name={item.name} valuePropName="checked">
         <Checkbox>{item.label}</Checkbox>
       </Form.Item>
     );
   } else if (item.options.length < 6) {
     return (
       <Form.Item name={item.name} label={item.label}>
         <Radio.Group options={item.options} />
       </Form.Item>
     );
   }
  return (
    <Form.Item name={item.name} label={item.label}>
      <Select>
        {item.options.map((option) => (
          <Select.Option key={option.value} value={option.value}>
            {option.label}
          </Select.Option>
        ))}
      </Select>
    </Form.Item>
  );
}

{'fraction_non_alphanumeric': 0.16852928028609745, 'fraction_numerical': 0.001788109074653554, 'mean_word_length': 2.513343799058085, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 34, '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': '7589848', 'n_tokens_mistral': 708, 'n_tokens_neox': 706, 'n_words': 153}