@php
    $price = (int) ($post->meta['price'] ?? 0);
@endphp

<div class="paid-teaser" role="note" aria-label="付费内容">
    <span>本文包含付费内容</span>
    @auth
        @if($price > 0)
            <form action="{{ route('posts.unlock', $post) }}" method="post" style="display:inline">
                @csrf
                <button type="submit" class="btn btn-primary">单篇解锁 ¥{{ number_format($price / 100, 2) }}</button>
            </form>
        @else
            <a href="{{ route('membership.index') }}" class="btn btn-primary">开通会员</a>
        @endif
    @else
        <a href="{{ route('login') }}" class="btn btn-primary">登录后查看</a>
    @endauth
</div>
