<commit_before>// @flow strict-local

import React from "preact";

import { classlist } from "../shared/main";

type Props = {|
  id: string,
  connected?: boolean,
  fullWidth?: boolean,
  label: React.Node,
  span?: boolean,
  description?: React.Node,
  changed: boolean,
  changedRight?: boolean,
  render: ({| id: string |}) => React.Node,
|};

export default function Field({
  id,
  connected = false,
  fullWidth = false,
  label,
  span = false,
  description,
  changed,
  changedRight = false,
  render,
}: Props) {
  return (
    <div
      className={classlist("Field", "SpacedVertical", {
        "is-connected": connected,
        "is-fullWidth": fullWidth,
        "is-changed": changed,
        "is-changedRight": changedRight,
      })}
    >
      <div>
        {span ? (
          <span className="Field-label">{label}</span>
        ) : (
          <label htmlFor={id} className="Field-label">
            {label}
          </label>
        )}

        {render({ id })}
      </div>

      {description != null && (
        <div className="Field-description TextSmall">
          {description}
        </div>
      )}
    </div>
  );
}<commit_msg>Run Prettier<commit_after>// @flow strict-local

import React from "preact";

import { classlist } from "../shared/main";

type Props = {|
  id: string,
  connected?: boolean,
  fullWidth?: boolean,
  label: React.Node,
  span?: boolean,
  description?: React.Node,
  changed: boolean,
  changedRight?: boolean,
  render: ({| id: string |}) => React.Node,
|};

export default function Field({
  id,
  connected = false,
  fullWidth = false,
  label,
  span = false,
  description,
  changed,
  changedRight = false,
  render,
}: Props) {
  return (
    <div
      className={classlist("Field", "SpacedVertical", {
        "is-connected": connected,
        "is-fullWidth": fullWidth,
        "is-changed": changed,
        "is-changedRight": changedRight,
      })}
    >
      <div>
        {span ? (
          <span className="Field-label">{label}</span>
        ) : (
          <label htmlFor={id} className="Field-label">
            {label}
          </label>
        )}

        {render({ id })}
      </div>

      {description != null && (
        <div className="Field-description TextSmall">{description}</div>
      )}
    </div>
  );
}
{'fraction_non_alphanumeric': 0.158963282937365, 'fraction_numerical': 0.0, 'mean_word_length': 2.289772727272727, 'pattern_counts': {'":': 8, '<': 23, '<?xml version=': 0, '>': 25, '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': '6018728', 'n_tokens_mistral': 729, 'n_tokens_neox': 717, 'n_words': 165}