{% import 'components/config/editable_config.html' as m_editable_config %}
{% macro config_trader_card(config, config_name, trader, add_class='', link='', action=None) -%}
    <!-- Card -->
    <div class="card mb-4 {{add_class}} config-card">

        <div class="card-header">
            <h4>
                {{trader}}
                <a class="float-right text-danger" target="_blank" rel="noopener noreferrer" href="{{link}}">
                    <i class="fa fa-question"></i>
                </a>
            </h4>
        </div>

        <!--Card content-->
        <div class="card-body">

            <p class="card-text config">
                {% for key in config %}
                    {{ m_editable_config.editable_key(  config,
                                                        key,
                                                        config_name + "_" + key,
                                                        "global_config",
                                                        config[key],
                                                        config[key])
                    }}
                {% endfor %}
                {% if action %}
                    <div class="text-center">
                        <button class="btn btn-warning waves-effect" type="button" action="post" update-url="{{ action[1] }}">{{ action[0] }}</button>
                    </div>
                {% endif %}
            </p>
        </div>
    </div>
{%- endmacro %}