import { useState } from 'react' import ClearIcon from 'shared/components/icons/clear.js' import { useTranslation } from 'next-i18next' const DesignOptionList = props => { const { t } = useTranslation(['app']) const { dflt, list } = props.pattern.config.options[props.option] const val = (typeof props.gist?.options?.[props.option] === 'undefined') ? dflt : props.gist.options[props.option] const [value, setValue] = useState(val) const handleChange = (newVal) => { if (newVal === dflt) reset() else { setValue(newVal) props.updateGist(['options', props.option], newVal) } } const reset = () => { setValue(dflt) props.unsetGist(['options', props.option]) } return (
{list.map(choice => ( ))}
) } export default DesignOptionList