<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
{% block sw_extension_review_creation %}
<sw-modal
    class="sw-extension-rating-modal"
    :title="$tc('sw-extension-store.component.sw-extension-ratings.sw-extension-review-creation-inputs.title')"
    variant="small"
    @modal-close="emitClose"
>
    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_extension_rating_modal_slot_default %}
    <template #default>
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_extension_rating_modal_slot_default_creation_inputs %}
        <sw-extension-review-creation-inputs
            :errors="errors"
            @changed="onChange"
        />
        {% endblock %}
    </template>
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_extension_rating_modal_slot_footer %}
    <template #modal-footer>
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_extension_rating_modal_slot_footer_gtc_checkbox %}
        <sw-gtc-checkbox
            v-model:value="tocAccepted"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_extension_rating_modal_slot_footer_buttons %}
        <div class="sw-extension-rating-modal__buttons">
            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_extension_rating_modal_slot_footer_buttons_cancel %}
            <sw-button
                size="small"
                :disabled="isLoading"
                @click="emitClose"
            >
                {{ $tc('global.default.cancel') }}
            </sw-button>
            {% endblock %}

            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_extension_rating_modal_slot_footer_buttons_submit %}
            <sw-button-process
                variant="primary"
                size="small"
                :is-loading="isLoading"
                :process-success="isCreatedSuccessful"
                :disabled="disabled"
                @update:process-success="emitClose"
                @click="handleCreateReview"
            >
                {{ $tc('sw-extension-store.component.sw-extension-ratings.sw-extension-review-creation.submitBtn') }}
            </sw-button-process>
            {% endblock %}
        </div>
        {% endblock %}
    </template>
    {% endblock %}
</sw-modal>
{% endblock %}
