Files
coolify/resources/views/components/notification/channel-actions.blade.php
Andras Bacsai 5de6f97256 feat(ui): unify resource nav sidebars and polish project layouts
Extract application/database/service configuration sidebars and
unified headings; improve clone-to-environment, embedded deployments,
storage actions, OAuth icons, terminal, and shared form components.
2026-08-05 17:56:59 +02:00

29 lines
965 B
PHP

@props([
'enabled',
'enabledProperty',
'toggleMethod',
'testMethod' => 'sendTestNotification',
'canUpdate' => true,
])
<div class="flex items-center gap-2"
x-data="{
enabled: @js((bool) $enabled),
enabledProperty: @js($enabledProperty),
toggleMethod: @js($toggleMethod),
testMethod: @js($testMethod),
}">
<x-forms.button type="button" :disabled="!$canUpdate" :isHighlighted="!$enabled"
x-on:click="
if (!enabled && !$el.closest('form').reportValidity()) return;
$wire.$set(enabledProperty, !enabled).then(() => $wire.$call(toggleMethod));
">
{{ $enabled ? 'Disable' : 'Enable' }}
</x-forms.button>
<x-forms.button type="button" :disabled="!$enabled"
x-on:click="if ($el.closest('form').reportValidity()) $wire.$call(testMethod)">
<x-reicon name="notifications" class="size-3.5" />
Send test
</x-forms.button>
</div>