UNPKG

@assistant-ui/react

Version:

TypeScript/React library for AI Chat

17 lines (16 loc) 446 B
"use client"; // src/primitives/thread/ThreadEmpty.tsx import { useAssistantState } from "../../context/index.js"; var ThreadPrimitiveEmpty = ({ children }) => { const empty = useAssistantState( ({ thread }) => thread.messages.length === 0 && !thread.isLoading ); return empty ? children : null; }; ThreadPrimitiveEmpty.displayName = "ThreadPrimitive.Empty"; export { ThreadPrimitiveEmpty }; //# sourceMappingURL=ThreadEmpty.js.map