@extends('admin.layout.master')

@section('title', 'Dil Yönetimi')

@section('breadcrumb')
    <div class="container-fluid px-4">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb my-0">
                <li class="breadcrumb-item"><a href="{{ route('admin.dashboard.index') }}">Anasayfa</a>
                </li>
                <li class="breadcrumb-item active"><span>Diller</span>
                </li>
            </ol>
        </nav>
    </div>
@stop

@section('content')

    <div class="container-lg px-4">
        <div class="card mb-4">
            <livewire:admin.language.show-languages />
        </div>
    </div>

@section('css')
<link href="{{ URL::to('admin/vendors/@coreui/icons/css/free.min.css') }}" rel="stylesheet">
<link href="{{ URL::to('admin/vendors/@coreui/icons/css/flag.min.css') }}" rel="stylesheet">

@livewireStyles
@stop

@section('js')

@livewireScripts
<script src="https://cdn.jsdelivr.net/gh/livewire/sortable@v1.x.x/dist/livewire-sortable.js"></script>

<script>
    const toastConfig = {
        toast: true,
        position: 'top-end',
        showConfirmButton: false,
        timer: 2000,
        timerProgressBar: true,
    };

    document.addEventListener('livewire:init', () => {
        Livewire.on('resetSwitch', (event) => {
            const switchElement = document.getElementById(`flexSwitchCheckDefaultXlDefault_${event.id}`);
            if (switchElement) {
                switchElement.checked = !switchElement.checked;
            }
        });

        Livewire.on('showAlert', (event) => {
            Swal.fire({
                ...toastConfig,
                // title: event[0].title,
                text: event[0].text,
                icon: event[0].icon,
            });
        });
    });
</script>


@stop

@stop
