40 lines
2.2 KiB
PHP
40 lines
2.2 KiB
PHP
<div>
|
|
<x-topbar :title="__('nav.automations')" :subtitle="__('automations.subtitle')">
|
|
<x-slot:actions>
|
|
<button type="button" wire:click="$dispatch('openModal', { component: 'modals.create-automation' })"
|
|
class="inline-flex items-center gap-1.5 rounded-lg bg-accent px-3 py-1.5 text-[12px] font-bold text-base hover:brightness-110 transition-[filter]">
|
|
<x-icon name="plus" :size="15" /> <span class="hidden sm:inline">{{ __('automations.add') }}</span>
|
|
</button>
|
|
</x-slot:actions>
|
|
</x-topbar>
|
|
|
|
<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>
|