<commit_before>import { h, render } from 'preact-cycle'
/** @jsx h */

const Toggle = (state, input) => {
  todo.done = !todo.done
  return state
}

const SetLayerHeight = (state, input) => {
  todo.done = !todo.done
  return state
}

const actions = {Toggle}

const PrintSettings = ({t}) => {

  const layerHeights = [0.2, 0.15, 0.1, 0.06]
  const layerHeightNames = {
    '0.2': t('activity_print_settings_text_draft'),
    '0.15': t('activity_print_settings_text_fast'),
    '0.1': t('activity_print_settings_text_normal'),
    '0.06': t('activity_print_settings_text_high')
  }
  const layerHeightUnit = 'mm'

  const layerHeightButtons = layerHeights.map(function (height) {
    const buttonText = `${layerHeightNames[height]}\n${height} ${layerHeightUnit}`
    return <li>
      <button>{buttonText}</button>
    </li>
  })

  return <section className='printSettings'>
           <header>
             {t('activity_print_settings_text_info')}
           </header>
           <section className='info'>
             {t('activity_print_settings_text_the_app_only_supports')}
           </section>
           <section className='profile'>
             <header>
               {t('activity_print_settings_layer_height_description')}
             </header>
             <ul>
              {layerHeightButtons}
             </ul>
           </section>
         </section>
}

export default PrintSettings<commit_msg>feat(printSettings): fleshed out printSettings: now overall ui structure matched the app<commit_after>import { h, render } from 'preact-cycle'
/** @jsx h */

const Toggle = (state, input) => {
  todo.done = !todo.done
  return state
}

const SetLayerHeight = (state, input) => {
  todo.done = !todo.done
  return state
}

const actions = {Toggle}

const PrintSettings = ({t}) => {

  const selectedSupportMaterial = 'pva'

  const state = {
    support: {toggled: true},
    brim: {toggled: true}
  }
  const {support, brim} = state

  const layerHeights = [0.2, 0.15, 0.1, 0.06]
  const layerHeightNames = {
    '0.2': t('activity_print_settings_text_draft'),
    '0.15': t('activity_print_settings_text_fast'),
    '0.1': t('activity_print_settings_text_normal'),
    '0.06': t('activity_print_settings_text_high')
  }
  const layerHeightUnit = 'mm'

  const layerHeightButtons = layerHeights.map(function (height) {
    const buttonText = `${layerHeightNames[height]}
${height} ${layerHeightUnit}`
    return <li>
             <button>
               {buttonText}
             </button>
           </li>
  })

  const supportMaterials = ['pva', 'pla']

  const supportMaterialsUi = supportMaterials.map(function (supportMaterial) {
    return <div>
             <input
               type="radio"
               name='supportMaterials'
               value={supportMaterial}
               checked={supportMaterial === selectedSupportMaterial}>
             {supportMaterial}
             </input>
             Extruder 1:
             {supportMaterial}
           </div>
  })

  return <section className='printSettings'>
           <header>
             {t('activity_print_settings_text_info')}
           </header>
           <section className='info'>
             {t('activity_print_settings_text_the_app_only_supports')}
           </section>
           <section className='profile'>
             <header>
               <h1>{t('activity_print_settings_text_print_profile')}</h1>
               {t('activity_print_settings_layer_height_description')}
             </header>
             <div className='layerHeights'>
               <ul>
                 {layerHeightButtons}
               </ul>
             </div>
           </section>
           <section className='supports'>
             <header>
               <h1>{t('activity_print_settings_text_support_structure')} <input type='checkbox' checked={support.toggled} /></h1>
             </header>
             <div disabled={support.toggled ? false : 'disabled'}>
               {t('activity_print_settings_text_select_support_structure_description')}
               <form>
                 {supportMaterialsUi}
               </form>
             </div>
           </section>
           <section className='brim'>
             <header>
               <h1>{t('activity_print_settings_text_adhesion_brim')} <input type='checkbox' checked={brim.toggled} /></h1>
             </header>
             <div disabled={brim.toggled ? false : 'disabled'}>
               {t('activity_print_settings_text_brim_description')}
             </div>
           </section>
         </section>
}

export default PrintSettings
{'fraction_non_alphanumeric': 0.1289198606271777, 'fraction_numerical': 0.010235191637630661, 'mean_word_length': 2.2901146131805157, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 69, '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': '6233831', 'n_tokens_mistral': 1364, 'n_tokens_neox': 1342, 'n_words': 254}