@php
    $c = config('theme.colors');
@endphp
<div class="card mb-3">
    <div class="card-header d-flex justify-content-between align-items-center">
        <h3 class="card-title mb-0" style="color: {{ $c['text'] }}">{{ __('tenants.fields.lifecycle') }}: <code>{{ $tenant->lifecycle_state }}</code></h3>
        <x-ui.buttons.secondary :href="route('admin.operations.tenants.diagnostics', $tenant)" class="btn-sm">
            {{ __('operations.tenant_diagnostics_title') }}
        </x-ui.buttons.secondary>
    </div>
    <div class="card-body">
        <div class="row g-2">
            <div class="col-md-6">
                <form method="post" action="{{ route('admin.tenants.lifecycle.suspend', $tenant) }}" class="d-grid gap-1">
                    @csrf
                    <textarea name="reason" class="form-control form-control-sm" rows="2" required placeholder="{{ __('tenant_lifecycle.reason') }}"></textarea>
                    <x-ui.buttons.primary type="submit" size="sm">{{ __('tenant_lifecycle.suspend') }}</x-ui.buttons.primary>
                </form>
            </div>
            <div class="col-md-6">
                <form method="post" action="{{ route('admin.tenants.lifecycle.resume', $tenant) }}" class="d-grid gap-1">
                    @csrf
                    <textarea name="reason" class="form-control form-control-sm" rows="2" required placeholder="{{ __('tenant_lifecycle.reason') }}"></textarea>
                    <x-ui.buttons.primary type="submit" size="sm">{{ __('tenant_lifecycle.resume') }}</x-ui.buttons.primary>
                </form>
            </div>
            <div class="col-md-6">
                <form method="post" action="{{ route('admin.tenants.lifecycle.activate', $tenant) }}" class="d-grid gap-1">
                    @csrf
                    <textarea name="reason" class="form-control form-control-sm" rows="2" required placeholder="{{ __('tenant_lifecycle.reason') }}"></textarea>
                    <x-ui.buttons.primary type="submit" size="sm">{{ __('tenant_lifecycle.activate') }}</x-ui.buttons.primary>
                </form>
            </div>
            <div class="col-md-6">
                <form method="post" action="{{ route('admin.tenants.lifecycle.archive', $tenant) }}" class="d-grid gap-1" onsubmit="return confirm('Archive?');">
                    @csrf
                    <textarea name="reason" class="form-control form-control-sm" rows="2" required placeholder="{{ __('tenant_lifecycle.reason') }}"></textarea>
                    <x-ui.buttons.primary type="submit" size="sm">{{ __('tenant_lifecycle.archive') }}</x-ui.buttons.primary>
                </form>
            </div>
        </div>
    </div>
</div>
