@php $pageTitle = '我的订阅 - '.$siteName; @endphp
@include('partials.head')
<body>
@include('partials.header')
<div class="container main-layout">
    <main class="content">
        <h1 class="list-title">我的订阅</h1>
        @forelse($subscriptions as $subscription)
            <div class="post-card">
                <h2 class="post-title">{{ $subscription->plan?->name ?? '（已下架）' }}</h2>
                <div class="post-meta">
                    <span>状态：
                        @if($subscription->isActive())
                            <span class="badge">生效中</span>
                        @else
                            <span style="color:#c00;">{{ $subscription->status === 'expired' ? '已过期' : '已取消' }}</span>
                        @endif
                    </span>
                    <span>· 开始：{{ $subscription->starts_at?->format('Y-m-d') }}</span>
                    <span>· 到期：{{ $subscription->ends_at?->format('Y-m-d') }}</span>
                </div>
            </div>
        @empty
            <div class="empty">暂无订阅记录，<a href="{{ route('membership.index') }}">去开通会员</a></div>
        @endforelse
    </main>
    @include('partials.sidebar')
</div>
@include('partials.footer')
</body>
</html>
