import { CircleAlertIcon, InfoIcon } from "lucide-react"; import { useId } from "react"; import { Switch } from "../../../ui/switch"; /** This chat's ChatGPT/Codex plan is out of usage: when it resets, and whether the chat goes on then. */ export type CodexUsageChoice = { /** Plain reset sentence, for example "Resets Sat 14:05." or "Reset time unknown.". */ resetText: string; /** The chat waits for the limit and continues on its own when it resets. */ continueAtReset: boolean; pending?: boolean | undefined; /** Why the last change did not go through, in words. */ error?: string | null | undefined; /** Off pauses the waiting chat, so it waits for the person; on lets it continue at the reset. */ onContinueAtResetChange: (continueAtReset: boolean) => void; }; /** * One plain line shown when the chosen model will rebuild a chat Codex * compacted, so the user knows earlier detail may be summarized away. */ export function ModelSwitchHeadsUp({ text, className }: { text: string; className?: string }) { return (

{text}

); } /** The "Continue at reset" switch, for the composer notice and the failed-chat banner. */ export function ContinueAtResetSwitch({ continueAtReset, pending = false, onContinueAtResetChange, }: CodexUsageChoice) { const id = useId(); return ( ); } /** * Composer line while this chat's ChatGPT/Codex plan is out of usage: when it * resets, and whether the chat continues then. Another model from the picker * continues the chat at once. The timeline already says why it stopped. */ export function CodexUsageNotice({ choice }: { choice: CodexUsageChoice }) { return (

Codex usage limit reached. {choice.resetText}

{choice.error ? (

{choice.error}

) : null}
); }