@extends('layouts.app')

@section('content')
<div id="accountLeave" class="container">

    @include('account.navTabs')

    <dl>
        <dt>회원탈퇴</dt>
        <dd>탈퇴 유의사항</dd>
        <dd>탈퇴한 계정은 본인과 타인 모두 재사용 및 복구가 불가하오니 신중하게 선택하시기 바랍니다.</dd>
        <dd>탈퇴 후 회원정보 및 개인형 서비스 이용기록은 모두 삭제됩니다.</dd>
        <dd>각종 게시판의 게시글, 댓글 등의 데이터는 삭제되지 않습니다. 반드시 탈퇴 전 직접 삭제하셔야 합니다.</dd>
        <dd>회원 탈퇴 후 모든 상품 주문 정보는 5년간 분리 보관됩니다.</dd>
    </dl>

    <hr/>
    <form name="f_account_leave" id="fAccountLeave" method="post" action="{{ route('account.leave.update') }}" autocomplete="off">
        @csrf
        <table class="table table-borderless">
            <colgroup>
                <col width="25%"/>
                <col width="*"/>
            </colgroup>
            <tr>
                <th rowspan="5">계정</th>
                <td>
                    <label for="email">이메일</label>
                    <input type="text" name="email" id="email" class="form-control-plaintext" value="{{ $user->email }}" readonly />
                </td>
            </tr>
            <tr>
                <td>
                    <label for="password" class="form-label">비밀번호</label>
                    <input type="password" name="password" id="password" class="form-control" required minlength="{{ config('password_min_length', 0) }}" />
                </td>
            </tr>
            <tr>
                <td>
                    <label for="passwordConfirm" class="form-label">비밀번호 확인</label>
                    <input type="password" name="password_confirmation" id="passwordConfirm" class="form-control" required />
                </td>
            </tr>
            <tr>
                <td>
                    <label for="withdrawal" class="form-label">탈퇴 동의</label>
                    <div class="form-check">
                        <input type="checkbox" name="withdrawal" id="withdrawal" class="form-check-input" value="1" />
                        <label for="withdrawal" class="form-check-label">안내사항을 모두 확인하였으며, 이에 동의합니다.</label>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="row g-2">
                        <div class="col-auto">
                            <button type="submit" class="btn btn-success">확인</button>
                        </div>
                        <div class="col-auto">
                            <a href="{{ route('account.profile') }}" class="btn btn-default">취소</a>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </form>
    <hr/>
</div>
@endsection

@push('styles')
    <link rel="stylesheet" href="{{ asset('css/desktop/account/leave.css') }}"/>
@endpush

@push('scripts')
    <script src="{{ asset('js/account/leave.js') }}" defer></script>
@endpush
