import { useState } from 'react' import { ClearIcon, EditIcon } from 'shared/components/icons.mjs' import { useTranslation } from 'next-i18next' const EditCount = (props) => (
) const DesignOptionCount = (props) => { const { t } = useTranslation(['app']) const { count, max, min } = props.design.patternConfig.options[props.option] const val = typeof props.gist?.options?.[props.option] === 'undefined' ? count : props.gist.options[props.option] const [value, setValue] = useState(val) const [editCount, setEditCount] = useState(false) const handleChange = (evt) => { const newVal = evt.target.value setValue(newVal) props.updateGist(['options', props.option], newVal) } const reset = () => { setValue(count) props.unsetGist(['options', props.option]) } return (
{editCount ? ( ) : ( <> {min} {val} {max} )}
) } export default DesignOptionCount