Skip to content

Commit

Permalink
Componente de los videos
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon-Meneses committed Nov 8, 2023
1 parent 263958a commit 44e086a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 22 deletions.
20 changes: 20 additions & 0 deletions app/View/Components/VideoTable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\View\Components;

use Illuminate\View\Component;

class VideoTable extends Component
{
public $videos;

public function __construct($videos)
{
$this->videos = $videos;
}

public function render()
{
return view('components.video-table');
}
}
22 changes: 22 additions & 0 deletions resources/views/components/video-table.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div class="mt-4 flex items-center justify-center mb-16">
<div class="w-full max-w-screen-md p-4 bg-white rounded-lg shadow-lg">
<table class="w-full border-collapse border border-gray-300">
<thead>
<tr>
<th class="border border-gray-300 px-4 py-2">N°</th>
<th class="border border-gray-300 px-4 py-2">Contenido</th>
</tr>
</thead>
<tbody>

@foreach ($videos as $video)
<tr>
<td class="border border-gray-300 px-4 py-2">{{$video->orden}}</td>
<td class="border border-gray-300 px-4 py-2">{{$video->nombre}}</td>
</tr>
@endforeach

</tbody>
</table>
</div>
</div>
24 changes: 2 additions & 22 deletions resources/views/detalle_curso.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,7 @@
</div>

{{-- tabla de los nombres video que se brindarán: --}}
<div class="mt-4 flex items-center justify-center mb-16">
<div class="w-full max-w-screen-md p-4 bg-white rounded-lg shadow-lg">
<table class="w-full border-collapse border border-gray-300">
<thead>
<tr>
<th class="border border-gray-300 px-4 py-2">N°</th>
<th class="border border-gray-300 px-4 py-2">Contenido</th>
</tr>
</thead>
<tbody>

@foreach ($videos as $video)
<tr>
<td class="border border-gray-300 px-4 py-2">{{$video->orden}}</td>
<td class="border border-gray-300 px-4 py-2">{{$video->nombre}}</td>
</tr>
@endforeach

</tbody>
</table>
</div>
</div>
<x-video-table :videos="$videos" />


</x-guest-layout>

0 comments on commit 44e086a

Please sign in to comment.