import React from 'react' import MeasurementInput from '../inputs/measurement.js' import { withBreasts, withoutBreasts } from 'pkgs/models/src/index.js' import nonHuman from './non-human.js' import WithBreastsIcon from 'shared/components/icons/with-breasts.js' import WithoutBreastsIcon from 'shared/components/icons/without-breasts.js' const groups = { people: { with: withBreasts, without: withoutBreasts, }, dolls: { with: nonHuman.withBreasts.dolls, without: nonHuman.withoutBreasts.dolls, }, giants: { with: nonHuman.withBreasts.giants, without: nonHuman.withoutBreasts.giants, } } const icons = { with: , without: , } const WorkbenchMeasurements = ({ app, pattern, gist, updateGist }) => { // Method to handle measurement updates const updateMeasurements = (value, m=false) => { if (m === false) { // Set all measurements updateGist('measurements', value) } else { // Set one measurement const newValues = {...gist.measurements} newValues[m] = value updateGist('measurements', newValues) } } // Save us some typing const inputProps = { app, updateMeasurements, gist } return (

{pattern.config.name}: {app.t('measurements')}

{app.t('cfp.preloadMeasurements')}

{Object.keys(groups).map(group => (

{app.t(`app.${group}`)}

{Object.keys(icons).map(type => (

{app.t(`app.${type}Breasts`)}

    {Object.keys(groups[group][type]).map((m) => (
  • ))}
))}
))}

{app.t('cfp.enterMeasurements')}

{pattern.config.measurements && ( <>

{app.t('requiredMeasurements')}

{pattern.config.measurements.map(m => ( ))} )} {pattern.config.optionalMeasurements && ( <>

{app.t('optionalMeasurements')}

{pattern.config.optionalMeasurements.map(m => ( ))} )}
) } export default WorkbenchMeasurements