{% extends request.ajax ? 'layout_blank.html.twig' : 'layout_default.html.twig' %}

{% block meta_title %}{{ 'Canned Category'|trans }}{% endblock %}

{% set active_menu = 'support' %}

{% block breadcrumbs %}
    <ol class="breadcrumb">
        <li class="breadcrumb-item">
            <a href="{{ '/'|url }}">
                <svg class="icon">
                    <use xlink:href="#home" />
                </svg>
            </a>
        </li>
        <li class="breadcrumb-item">
            <a href="{{ 'support'|url }}">{{ 'Support'|trans }}</a>
        </li>
        <li class="breadcrumb-item">
            <a href="{{ 'support/canned-responses'|url }}">{{ 'Canned Responses'|trans }}</a>
        </li>
        <li class="breadcrumb-item">
            <a href="{{ 'support/canned-responses'|url }}#tab-categories">{{ 'Categories'|trans }}</a>
        </li>
        <li class="breadcrumb-item active" aria-current="page">{{category.title}}</li>
    </ol>
{% endblock %}

{% block content %}
<div class="card">
    <form method="post" action="{{ 'support/canned_category_update'|api_url }}" {{ fb_api_form({ redirect: 'support/canned-responses#tab-categories'|url }) }}>
        {% embed 'partial_admin_form_card.html.twig' with {
            title: 'Canned Category'|trans,
            subtitle: category.title,
            body_class: 'pt-4'
        } %}
            {% block form_content %}
                <div class="row g-3">
                    <div class="col-lg-6">
                        <label class="form-label">{{ 'Title'|trans }}</label>
                        <input class="form-control" type="text" name="title" value="{{ category.title }}" required>
                    </div>
                </div>
                <input type="hidden" name="id" value="{{ category.id }}">
            {% endblock %}

            {% block form_actions %}
                <button class="btn btn-primary" type="submit">{{ 'Update'|trans }}</button>
            {% endblock %}
        {% endembed %}
    </form>
</div>
{% endblock %}
