import "./editor.scss";
import Popup from "../popup/popup";
const SelectDropdown = ({
label,
options,
attributes,
setAttributes,
attributesKey,
onClick = null,
className = "",
onClose,
}) => {
return (
<>
{/*
{ options?.map( ( option, index ) => (
- {
selectHandler( option.value );
if ( typeof onClose === 'function' ) {
onClose();
console.log( 'hello' )
}
} }
>
{ option.label && { option.label } }
{ option.icon && { option.icon } }
) ) }
*/}
>
);
};
export default SelectDropdown;
const SelectDropField = ({
options,
attributes,
setAttributes,
attributesKey,
onClick = null,
className = "",
onClose,
}) => {
const selectHandler = (value) => {
if (onClick) {
onClick(value);
} else {
setAttributes({ [attributesKey]: value });
}
};
return (
{options?.map(({value, label, icon, disabled, type = ""}, index) => (
- {
selectHandler(value);
if (typeof onClose === "function") {
onClose();
}
}}
>
{label && {`${label}`}
{"pro" === type && (Pro) }
}
{icon && {icon}}
))}
);
};