<commit_before>import * as PropTypes from 'prop-types'
import React, { ReactNode } from 'react'
import cn from 'classnames'
import { useListOption } from './FocusListContext'

export const CREATE_OPTION = {}

const propTypes = {
  searchTerm: PropTypes.string,
  focused: PropTypes.bool,
  onSelect: PropTypes.func.isRequired,
  activeId: PropTypes.string,
}

export interface AddToListOptionProps {
  children: ReactNode
  onSelect: (event: React.MouseEvent) => void
}

function AddToListOption({
  children,
  onSelect,
  ...props
}: AddToListOptionProps) {
  const [ref, focused, id] = useListOption(CREATE_OPTION)

  return (
    <button
      id={id}
      ref={ref as any}
      data-rw-focusable
      data-rw-focused={focused ? '' : undefined}
      className={cn('rw-list-option-create', focused && 'rw-state-focus')}
      onClick={onSelect}
      {...props}
    ><commit_msg>fix: add type=button on AddToListOption (#1017)<commit_after>import * as PropTypes from 'prop-types'
import React, { ReactNode } from 'react'
import cn from 'classnames'
import { useListOption } from './FocusListContext'

export const CREATE_OPTION = {}

const propTypes = {
  searchTerm: PropTypes.string,
  focused: PropTypes.bool,
  onSelect: PropTypes.func.isRequired,
  activeId: PropTypes.string,
}

export interface AddToListOptionProps {
  children: ReactNode
  onSelect: (event: React.MouseEvent) => void
}

function AddToListOption({
  children,
  onSelect,
  ...props
}: AddToListOptionProps) {
  const [ref, focused, id] = useListOption(CREATE_OPTION)

  return (
    <button
      id={id}
      ref={ref as any}
      data-rw-focusable
      data-rw-focused={focused ? '' : undefined}
      className={cn('rw-list-option-create', focused && 'rw-state-focus')}
      onClick={onSelect}
      type="button"
      {...props}
    >
{'fraction_non_alphanumeric': 0.12705366922234393, 'fraction_numerical': 0.002190580503833516, 'mean_word_length': 3.7209302325581395, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5822699', 'n_tokens_mistral': 582, 'n_tokens_neox': 584, 'n_words': 136}