@extends('layout')
@section('title', __('store.emailhosting_forwarders'))
@section('content')
<div class="container py-4" id="emailPanel"
     data-handle-url="{{ route('store.auth.services.action.handle', [$service->id, 'forwarders']) }}"
     data-csrf="{{ csrf_token() }}">
    <x-clientarea.page-header icon="fas fa-share" :title="__('store.emailhosting_forwarders')">
        <a href="{{ route('store.auth.services.details', $service->id) }}" class="btn btn-outline-secondary">
            <i class="fas fa-arrow-left me-1"></i>{{ __('store.common_back') }}
        </a>
    </x-clientarea.page-header>

    <div class="card shadow-sm border-0 mb-3">
        <div class="card-body">
            <form id="forwarderAddForm" class="row g-2">
                <div class="col-md-5"><input type="text" class="form-control" name="source" placeholder="{{ __('store.emailhosting_forwarder_source') }}" required></div>
                <div class="col-md-5"><input type="text" class="form-control" name="destination" placeholder="{{ __('store.emailhosting_forwarder_destination') }}" required></div>
                <div class="col-md-2 d-grid"><button class="btn btn-primary" type="submit">{{ __('store.emailhosting_add') }}</button></div>
            </form>
        </div>
    </div>

    <div id="forwarderAlert"></div>
    <div class="card shadow-sm border-0">
        <div class="table-responsive">
            <table class="table align-middle mb-0">
                <thead><tr><th>{{ __('store.emailhosting_forwarder_source') }}</th><th>{{ __('store.emailhosting_forwarder_destination') }}</th><th></th></tr></thead>
                <tbody id="forwarderRows"><tr><td colspan="3" class="text-muted text-center py-3">…</td></tr></tbody>
            </table>
        </div>
    </div>
</div>
@endsection
@push('scripts')
@vite('resources/js/store/emailhosting/forwarders.js')
@endpush
