"use client"; import { useChatDispatch, useChatState } from "@/stores/chat/chat-context"; import type { ChatUnlockPaywallRequest } from "@/stores/chat/chat-state"; import { HistoryUnlockDialog } from "./history-unlock-dialog"; import { InsufficientCreditsDialog } from "./insufficient-credits-dialog"; export interface ChatUnlockDialogsProps { unlockPaywallRequest: ChatUnlockPaywallRequest | null; onCloseInsufficientCreditsDialog: () => void; onConfirmInsufficientCreditsDialog: () => void; includeHistoryUnlock?: boolean; } export function ChatUnlockDialogs({ unlockPaywallRequest, onCloseInsufficientCreditsDialog, onConfirmInsufficientCreditsDialog, includeHistoryUnlock = true, }: ChatUnlockDialogsProps) { const chatState = useChatState(); const chatDispatch = useChatDispatch(); return ( <> {includeHistoryUnlock ? ( chatDispatch({ type: "ChatUnlockHistoryDismissed" })} onConfirm={() => chatDispatch({ type: "ChatUnlockHistoryConfirmed" })} /> ) : null} ); }