import { useHidePersonalData } from '../../personalDataSecurity';
export const useLogic = ({ onChange, isHidePersonalData, }) => {
    const handleChange = (_, newValue) => {
        if (typeof newValue === 'string') {
            return onChange({ addressString: newValue });
        }
        if (newValue) {
            return onChange(newValue);
        }
    };
    const getOptionLabel = (option) => {
        return typeof option === 'string' ? option : option.addressString;
    };
    const hidePersonalInputDataClassname = useHidePersonalData({
        isEnabled: isHidePersonalData,
        type: 'input',
    });
    const hidePersonalDataClassname = useHidePersonalData({
        isEnabled: isHidePersonalData,
    });
    return {
        handleChange,
        getOptionLabel,
        hidePersonalInputDataClassname,
        hidePersonalDataClassname,
    };
};
