@extends('layouts.app')

@section('content')
<div id="accountProfile" class="container">
    @include('account.navTabs')

    <dl>
        <dt>회원 정보</dt>
        <dd>회원 정보는 개인정보보호정책에 의해 보호를 받습니다.</dd>
    </dl>

    <article>
        <hr/>
        <table class="table table-borderless">
            <colgroup>
                <col width="20%"/>
                <col width="*"/>
            </colgroup>
            <tr>
                <th rowspan="5">계정</th>
                <td>
                    <div class="row">
                        <div class="col">
                            <h6>ID</h6>
                            <small>{{ $user->sid }}</small>
                        </div>
                        <div class="col">
                            <h6>적립금</h6>
                            <small>{{ number_format($user->point) }}</small>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <hr/>
                </td>
            </tr>
            <tr>
                <td>
                    <h6>닉네임</h6>
                    <small>{{ $user->nickname }}</small>
                </td>
            </tr>
            <tr>
                <td>
                    <hr/>
                </td>
            </tr>
            <tr>
                <td>
                    <h6>이메일</h6>
                    <small>{{ $user->email }}</small>
                </td>
            </tr>
            <tr>
                <th colspan="2">
                    <hr/>
                </th>
            </tr>
            <tr>
                <th rowspan="7">부가 기능</th>
                <td>
                    <h6>프로필 이미지</h6>
                    @if($user->thumb)
                        <img src="{{ asset($user->thumb) }}" width="{{ THUMB_MAX_WIDTH }}" height="{{ THUMB_MAX_HEIGHT }}"/>
                    @else
                        <img src="/images/default/thumb.gif" width="{{ THUMB_MAX_WIDTH }}" height="{{ THUMB_MAX_HEIGHT }}"/>
                    @endif
                </td>
            </tr>
            <tr>
                <td>
                    <hr/>
                </td>
            </tr>
            <tr>
                <td>
                    <h6>오늘의 한마디</h6>
                    <small>{{ $user->today_message ?? '-' }}</small>
                </td>
            </tr>
            <tr>
                <td>
                    <hr/>
                </td>
            </tr>
            <tr>
                <td>
                    <h6>자기소개</h6>
                    <small>{{ $user->about_me ?? '-' }}</small>
                </td>
            </tr>
            <tr>
                <td>
                    <hr/>
                </td>
            </tr>
            <tr>
                <td>
                    <h6>정보 공개 여부</h6>
                    <small>{{ $user->is_open_profile ? '예' : '아니오' }}</small>
                </td>
            </tr>
            <tr>
                <th colspan="2">
                    <hr/>
                </th>
            </tr>
            <tr>
                <th>수신 여부</th>
                <td>
                    <div class="row">
                        <div class="col">
                            <h6>이메일(Email)</h6>
                            <small>{{ $user->receive_email ? '예' : '아니오' }}</small>
                        </div>
                        <div class="col">
                            <h6>문자(SMS)</h6>
                            <small>{{ $user->receive_sms ? '예' : '아니오' }}</small>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <th colspan="2">
                    <hr/>
                </th>
            </tr>
            <tr>
                <th rowspan="7">등록일시</th>
                <td>
                    <div class="row">
                        <div class="col">
                            <h6>회원가입 일시</h6>
                            <small>{{ $user->created_at }}</small>
                        </div>
                        <div class="col">
                            <h6>정보 수정 일시</h6>
                            <small>{{ $user->updated_at }}</small>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <hr/>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="row">
                        <div class="col">
                            <h6>최근 로그인 일시</h6>
                            <small>{{ $user->last_login_at }}</small>
                        </div>
                        <div class="col">
                            <h6>비밀번호 변경 일시</h6>
                            <small>{{ $user->password_updated_at }}</small>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
        <hr/>
        <div class="row g-2">
            <div class="col-auto">
                <a href="{{ route('account.modify') }}" class="btn btn-default">회원 정보 수정</a>
            </div>
            <div class="col-auto">
                <a href="{{ route('account.password') }}" class="btn btn-default">비밀번호 변경</a>
            </div>
            <div class="col-auto">
                <a href="{{ route('account.leave') }}" class="btn btn-default">회원탈퇴</a>
            </div>
        </div>
        <br/>
    </article>
</div>
@endsection

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