@foreach ($linhasHorarios as $lh)
<tr>
    <td><span class="badge bg-primary">{{ $lh->codigo }}</span></td>
    <td>{{ $lh->nome }}</td>
    <td class="text-center">
        @if ($lh->tarifa)
            R$ {{ number_format($lh->tarifa, 2, ',', '.') }}
        @else
            <span class="text-muted">-</span>
        @endif
    </td>
    <td class="text-center">
        <span class="badge bg-secondary">{{ $lh->secoes_count }}</span>
    </td>
    <td class="text-center">
        @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_MOBIANGRA')['editar'] ?? false)
        <div class="d-flex justify-content-center">
        <form class="m-0" action="{{ route('admin.mobiangra.horarios.linhas.status', $lh) }}" method="post">
            @csrf
            <input type="hidden" name="tab" value="horarios">
            <button type="submit" class="btn btn-sm {{ $lh->publicada ? 'btn-success' : 'btn-secondary' }}" title="{{ $lh->publicada ? __('Publicada') : __('Oculta') }}">
                <i class="fa-solid {{ $lh->publicada ? 'fa-eye' : 'fa-eye-slash' }}"></i>
            </button>
        </form>
        </div>
        @else
            <span class="badge {{ $lh->publicada ? 'bg-success' : 'bg-secondary' }}">
                {{ $lh->publicada ? __('Publicada') : __('Oculta') }}
            </span>
        @endif
    </td>
    <td class="text-center">
        <div class="d-flex justify-content-center align-items-center gap-2 flex-nowrap">
        @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_MOBIANGRA')['editar'] ?? false)
        <a href="{{ route('admin.mobiangra.horarios.linhas.edit', $lh) }}" class="btn btn-sm btn-outline-primary" title="{{ __('Editar') }}">
            <i class="fa-solid fa-pen"></i>
        </a>
        @endif
        @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_MOBIANGRA')['excluir'] ?? false)
        <form class="d-inline m-0" action="{{ route('admin.mobiangra.horarios.linhas.destroy', $lh) }}" method="post"
              onsubmit="return confirm('{{ __('Excluir a linha :cod e todos seus horários?', ['cod' => $lh->codigo]) }}')">
            @csrf @method('DELETE')
            <input type="hidden" name="tab" value="horarios">
            <button type="submit" class="btn btn-sm btn-outline-danger" title="{{ __('Excluir') }}">
                <i class="fa-solid fa-trash"></i>
            </button>
        </form>
        @endif
        </div>
    </td>
</tr>
@endforeach
