<div>
    {{-- Asignar empresa --}}
    @can('assign companies')
        <form wire:submit.prevent="assignCompany" class="flex items-end gap-2 mb-4">
            <div class="flex-1">
                <label class="label-text text-xs">{{ __('Companies') }}</label>
                <select wire:model="selectedCompanyId" class="select select-bordered select-sm w-full">
                    <option value="">{{ __('Select') }}...</option>
                    @foreach($allCompanies as $company)
                        <option value="{{ $company->id }}">{{ $company->name }} @if($company->tax_id) ({{ $company->tax_id }}) @endif</option>
                    @endforeach
                </select>
                @error('selectedCompanyId') <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 empresas asignadas --}}
    <livewire:projects.project-companies-table :project-id="$project->id" :key="'project-companies-table-'.$project->id" />
</div>
