<?php /**
 * Form Modal Component
 * Wrap ui.modal + form.actions
 * Usage:
 * <x-modals.form-modal id="myModal" title="Sửa" action="/update" formId="updateForm">
 *     ... inputs ...
 *     <x-slot name="actions">
 *         <button type="submit">Lưu</button>
 *     </x-slot>
 * </x-modals.form-modal>
 */ ?>
@props(['id', 'title', 'size' => 'md', 'action' => '', 'method' => 'POST', 'formId' => null])

<x-form.layout :action="$action" :method="$method" :id="$formId">
    <x-ui.modals type="modal" :id="$id" :title="$title" :size="$size">
        {{ $slot }}
        
        <x-slot name="footer">
            <x-form.actions>
                {{ $actions ?? '' }}
            </x-form.actions>
        </x-slot>
    </x-ui.modals>
</x-form.layout>
