UNPKG

@assistant-ui/react

Version:

Open-source TypeScript/React library for building production-grade AI chat experiences

26 lines (25 loc) • 1.04 kB
"use client"; import { createActionButton } from "../../utils/createActionButton.js"; import { useActionBarRefreshRun } from "@assistant-ui/core/react"; // src/primitives/actionBar/ActionBarRefreshRun.ts const useActionBarRefreshRun$1 = () => { const { disabled, refresh } = useActionBarRefreshRun(); if (disabled) return null; return refresh; }; /** * A button that re-reads an assistant message whose run another tab or * session is still writing, so the thread shows its latest stored state * without a page reload. The thread also re-reads it on its own around the * moment the run would cross `staleAfter`. It renders disabled unless * Assistant Cloud reported the run in progress elsewhere, and while a * refresh is in flight. * * @example * ```tsx * <ActionBarPrimitive.RefreshRun>Refresh</ActionBarPrimitive.RefreshRun> * ``` */ const ActionBarPrimitiveRefreshRun = createActionButton("ActionBarPrimitive.RefreshRun", useActionBarRefreshRun$1); export { ActionBarPrimitiveRefreshRun }; //# sourceMappingURL=ActionBarRefreshRun.js.map