{# Copyright 2024, 2025 New Vector Ltd. Copyright 2021-2024 The Matrix.org Foundation C.I.C. SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. -#} {% macro link(text, uri, mode, params, type="button", kind="primary", destructive=False) %} {% if type == "button" %} {% if destructive %} {% set class = "cpd-button destructive" %} {% else %} {% set class = "cpd-button" %} {% endif %} {% elif type == "link" %} {% set class = "cpd-link" %} {% if destructive %} {% set kind = "critical" %} {% endif %} {% else %} {{ throw(message="Invalid type") }} {% endif %} {% if mode == "form_post" %}
{% elif mode == "fragment" or mode == "query" %} {{ text }} {% else %} {{ throw(message="Invalid mode") }} {% endif %} {% endmacro %}