feat(chat): add quota-exhausted banner for guest users

Introduce ChatQuotaExhaustedBanner component that displays a pink gradient
banner with an "Unlock your membership to continue" CTA when a guest user's
free chat quota has been exhausted. The banner is shown in ChatScreen when
isGuest is true, quota has loaded, and the chat state machine's
quotaExceededTrigger has been incremented by a quota guard. Default click
navigates to /subscription, with an optional onUnlock callback for
overrides/tests. Styles align with the existing splash and sidebar VIP
card visual language.
This commit is contained in:
2026-06-16 15:17:44 +08:00
parent 9ffa30cc03
commit dcb6312fa3
8 changed files with 153 additions and 39 deletions
-14
View File
@@ -1,19 +1,5 @@
"use client";
/**
* ChatStorage 完整实现(基于 unstorage 抽象)
*
* 对齐 Dart 端 `ChatStorage`lib/data/services/storage/chat/chat_storage.dart):
* - 游客每日聊天配额(GuestChatQuota{ remaining, date }
* - 游客总配额(int
*
* 注意:本类与 `LocalChatStorage`IndexedDB / Dexie)是不同类:
* - ChatStorage = 游客配额等元数据(KV)
* - LocalChatStorage = 聊天记录本身(IndexedDB
*
* 设计:内部使用 SpAsyncUtil 静态类 + Zod 校验;保持对外 API 完全兼容。
*/
import {
GuestChatQuotaSchema,
type GuestChatQuotaData,