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'
import { useTranslation } from 'next-i18next'
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 }) => {
const { t } = useTranslation(['app', 'cfp'])
// 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}:
{t('measurements')}
{t('cfp:preloadMeasurements')}
{Object.keys(groups).map(group => (
{t(group)}
{Object.keys(icons).map(type => (
{t(`${type}Breasts`)}
{Object.keys(groups[group][type]).map((m) => (
-
))}
))}
))}
{t('cfp:enterMeasurements')}
{pattern.config.measurements && (
<>
{t('requiredMeasurements')}
{pattern.config.measurements.map(m => (
))}
>
)}
{pattern.config.optionalMeasurements && (
<>
{t('optionalMeasurements')}
{pattern.config.optionalMeasurements.map(m => (
))}
>
)}
)
}
export default WorkbenchMeasurements