import React from 'react';

export default ({ field1c, curField1c, fieldCb, id, saveValue, editMode, editId }) => {
    const closeBtnHidden = (editId && fieldCb == editId && field1c == curField1c) ? (!editMode ? ' hidden-1c' : '') : ' hidden-1c';
    
    return (
        <>
            <button
                type="button"
                className={`user-data__close-edit-btn table-settings-btn${closeBtnHidden}`}
                id={`save-btn${id}`}
                field_type="field"
                onClick={(e) => {
                    saveValue(e);
                }}
                field_1c={field1c}
                field_cb={fieldCb}
 
            />
        </>
    )
};