<div>
    {{-- Asignar usuario --}}
    @can('assign users')
        <form wire:submit.prevent="assignUser" class="flex items-end gap-2 mb-4">
            <div class="flex-1">
                <label class="label-text text-xs">{{ __('Users') }}</label>
                <select wire:model="selectedUserId" class="select select-bordered select-sm w-full">
                    <option value="">{{ __('Select') }}...</option>
                    @foreach($allUsers as $u)
                        <option value="{{ $u->id }}">{{ $u->name }} ({{ $u->email }})</option>
                    @endforeach
                </select>
                @error('selectedUserId') <span class="text-error text-xs">{{ $message }}</span> @enderror
            </div>
            <div class="w-40">
                <label class="label-text text-xs">{{ __('Role') }}</label>
                <select wire:model="selectedRole" class="select select-bordered select-sm w-full">
                    @foreach($roles as $value => $label)
                        <option value="{{ $value }}">{{ $label }}</option>
                    @endforeach
                </select>
            </div>
            <button type="submit" class="btn btn-primary btn-sm">{{ __('Assign') }}</button>
        </form>
    @endcan

    {{-- Tabla Rappasoft de usuarios asignados --}}
    <livewire:projects.project-users-table :project-id="$project->id" :key="'project-users-table-'.$project->id" />
</div>
