movie-night-nuevo/resources/views/livewire/lists.blade.php

37 lines
1.4 KiB
PHP
Raw Normal View History

2025-12-13 19:33:52 -06:00
<div class="mt-5 w-full mx-auto flex flex-col gap-5">
<h1 class="font-bold text-3xl mx-2 sm:mx-0">Lists</h1>
<x-ui.card>
2025-12-12 23:07:04 -06:00
<div class="w-full flex flex-col gap-2">
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li class="text-red-500">{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
2025-12-13 19:33:52 -06:00
<form class="flex flex-col max-w-lg gap-2" wire:submit.prevent="addList">
<label class="font-bold" for="list_name">Add List</label>
2025-12-12 23:07:04 -06:00
<div class="flex">
2025-12-13 19:33:52 -06:00
<input name="list_name" placeholder="List Name"
class="flex-1 w-full text-black bg-white p-2 rounded rounded-r-none"
type="text"
2025-12-12 23:07:04 -06:00
wire:model="form.name">
<button type="submit" class="bg-green-400 text-white px-4 py-2 rounded rounded-l-none">Add</button>
</div>
</form>
</div>
2025-12-13 19:33:52 -06:00
<ul class="w-full flex flex-col gap-5">
2025-12-12 23:07:04 -06:00
@foreach($lists as $list)
2025-12-13 19:33:52 -06:00
<li class="flex justify-between text-center">
<a href="/lists/{{$list->id}}" wire:navigate>{{$list->name}}</a>
2025-12-12 23:07:04 -06:00
</li>
@endforeach
</ul>
2025-12-13 19:33:52 -06:00
</x-ui.card>
2025-12-12 23:07:04 -06:00
</div>
</div>