{% if error %}
    <div class="p-4 mb-4 text-sm text-red-700 bg-red-100 rounded-lg dark:bg-red-200 dark:text-red-800" role="alert">
        {{ error }}
    </div>
{% else %}
    <div class="p-4 mb-4 text-sm text-green-700 bg-green-100 rounded-lg dark:bg-green-200 dark:text-green-800" role="alert">
        {% if designer.id %}
            Designer "{{ designer.name }}" has been created successfully.
            <script>
                // Update the designer field in the parent form
                selectDesigner('{{ designer.id }}', '{{ designer.name }}');
                // Close the modal
                document.dispatchEvent(new CustomEvent('close-designer-modal'));
            </script>
        {% else %}
            Your designer submission "{{ designer.name }}" has been sent for review.
            You will be notified when it is approved.
            <script>
                // Close the modal after a short delay
                setTimeout(() => {
                    document.dispatchEvent(new CustomEvent('close-designer-modal'));
                }, 2000);
            </script>
        {% endif %}
    </div>
{% endif %}
