homeos/resources/views/livewire/automations/index.blade.php

33 lines
1.8 KiB
PHP

<div>
<x-topbar :title="__('nav.automations')" :subtitle="__('automations.subtitle')" />
<div class="px-5 lg:px-[26px] py-6 flex flex-col gap-5 max-w-[1560px] mx-auto w-full">
@if ($automations->isEmpty())
<x-panel>
<div class="flex flex-col items-center gap-3 py-8 text-center">
<span class="grid place-items-center w-12 h-12 rounded-xl bg-inset text-ink-3"><x-icon name="automation" :size="24" /></span>
<div>
<div class="text-[14px] font-semibold text-ink">{{ __('automations.empty_title') }}</div>
<div class="text-[12.5px] text-ink-3 mt-1 max-w-sm">{{ __('automations.empty_body') }}</div>
</div>
</div>
</x-panel>
@else
<x-panel>
<div class="flex flex-col divide-y divide-line-soft -my-1">
@foreach ($automations as $a)
<div class="flex items-center gap-3 py-3 first:pt-1 last:pb-1">
<span class="grid place-items-center w-9 h-9 rounded-lg bg-inset text-ink-2 shrink-0"><x-icon name="automation" :size="16" /></span>
<div class="min-w-0">
<div class="text-[13px] font-semibold text-ink truncate">{{ $a->name }}</div>
<div class="text-[11.5px] text-ink-3">{{ __('automations.trigger_'.$a->trigger_type) }}</div>
</div>
<x-toggle :on="$a->enabled" wire:click="toggle('{{ $a->uuid }}')" :label="$a->name" class="ml-auto" />
</div>
@endforeach
</div>
</x-panel>
@endif
</div>
</div>