30 lines
1.8 KiB
PHP
30 lines
1.8 KiB
PHP
<div wire:poll.30s>
|
|
<x-topbar :title="$room->name" :subtitle="__('nav.rooms')">
|
|
<x-slot:actions>
|
|
@php $deviceCount = $room->devices->count(); @endphp
|
|
<button type="button"
|
|
wire:click="$dispatch('openModal', { component: 'modals.confirm', arguments: { title: @js(__('rooms.delete_title')), body: @js($deviceCount > 0 ? __('rooms.delete_body', ['count' => $deviceCount]) : __('rooms.delete_body_empty')), confirmLabel: @js(__('rooms.delete')), event: 'deleteRoom', to: 'rooms.show', danger: true } })"
|
|
class="inline-flex items-center gap-1.5 rounded-lg border border-line-soft bg-raised px-2.5 py-1.5 text-[12px] font-semibold text-ink-3 hover:text-offline hover:border-offline/40 transition-colors">
|
|
<x-icon name="close" :size="14" /> <span class="hidden sm:inline">{{ __('rooms.delete') }}</span>
|
|
</button>
|
|
<a href="{{ route('rooms.index') }}" wire:navigate
|
|
class="inline-flex items-center gap-1.5 rounded-lg border border-line-soft bg-raised px-2.5 py-1.5 text-[12px] font-semibold text-ink-2 hover:text-ink transition-colors">
|
|
<x-icon name="chevron" :size="14" class="rotate-180" />
|
|
<span class="hidden sm:inline">{{ __('nav.rooms') }}</span>
|
|
</a>
|
|
</x-slot:actions>
|
|
</x-topbar>
|
|
|
|
<div class="px-5 lg:px-[26px] py-6 max-w-[1560px] mx-auto w-full">
|
|
@if ($room->devices->isEmpty())
|
|
<x-panel><p class="text-[13px] text-ink-3 text-center py-6">{{ __('rooms.no_devices') }}</p></x-panel>
|
|
@else
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3">
|
|
@foreach ($room->devices as $device)
|
|
<x-device-card :device="$device" />
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|