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:
@@ -1,16 +1,5 @@
|
||||
"use client";
|
||||
/**
|
||||
* ChatContext:基于 XState v5 的 React Context Provider
|
||||
*
|
||||
* 业务事件通过 `useMachine(chatMachine).send()` 派发。
|
||||
* XState 自动处理 HTTP 副作用(invoke + fromPromise actors)。
|
||||
*
|
||||
* 兼容性:保持原 `useChatState()` / `useChatDispatch()` API。
|
||||
* 内部将 XState 状态机快照映射回原 `ChatState` 形状。
|
||||
*
|
||||
* 注:WebSocket 长生命周期 actor 由 chat-screen.tsx 监听 auth 状态机驱动——
|
||||
* 鉴权解耦(loginStatus 在 auth,chat 机器不感知鉴权)。
|
||||
*/
|
||||
|
||||
import {
|
||||
type Dispatch,
|
||||
type ReactNode,
|
||||
|
||||
Reference in New Issue
Block a user