@extends('admin.layouts.app')

@section('content')
<div class="container-fluid">
    <h2>기타</h2>
    <hr/>
    @include('admin.messages')
    @include('admin.config.setting.navTabs')

    <form name="f_admin_write" id="fAdminWrite" method="post" action="{{ route('admin.config.setting.general.store') }}" enctype="multipart/form-data">
        @csrf
        <div class="alert alert-primary" role="alert">
            텔레그램 봇 토큰을 저장합니다. 이후 서비스 알림에 사용됩니다.
        </div>
        <div class="row mb-3">
            <label for="g2aOrderBotToken" class="col-sm-2 col-form-label">G2A Order Bot Token</label>
            <div class="col-sm-10">
                <input type="text" name="g2a_order_bot_token" id="g2aOrderBotToken" class="form-control" value="{{ $config->item('g2a_order_bot_token', old('g2a_order_bot_token')) }}"/>
            </div>
        </div>
        <div class="row mb-3">
            <label for="g2aProductBotToken" class="col-sm-2 col-form-label">G2A Product Bot Token</label>
            <div class="col-sm-10">
                <input type="text" name="g2a_product_bot_token" id="g2aProductBotToken" class="form-control" value="{{ $config->item('g2a_product_bot_token', old('g2a_product_bot_token')) }}"/>
            </div>
        </div>
        <div class="row mb-3">
            <label for="g2aErrorBotToken" class="col-sm-2 col-form-label">G2A Error Bot Token</label>
            <div class="col-sm-10">
                <input type="text" name="g2a_error_bot_token" id="g2aErrorBotToken" class="form-control" value="{{ $config->item('g2a_error_bot_token', old('g2a_error_bot_token')) }}"/>
            </div>
        </div>
        <div class="row mb-3">
            <label for="mainBotToken" class="col-sm-2 col-form-label">Main Bot Token</label>
            <div class="col-sm-10">
                <input type="text" name="main_bot_token" id="mainBotToken" class="form-control" value="{{ $config->item('main_bot_token', old('main_bot_token')) }}"/>
            </div>
        </div>
        <hr/>
        <div class="form-group text-end">
            <button type="submit" class="btn btn-success">저장하기</button>
        </div>
    </form>
</div>

<script type="module">
$("#fAdminWrite").validate({
    rules: {
        g2a_order_bot_token: {required: false, maxlength: 255},
        g2a_product_bot_token: {required: false, maxlength: 255},
        g2a_error_bot_token: {required: false, maxlength: 255},
        main_bot_token: {required: false, maxlength: 255},
    }
});
</script>
@endsection
