UNPKG

@assistant-ui/react

Version:

Typescript/React library for AI Chat

18 lines (17 loc) 482 B
"use client"; // src/primitives/contentPart/useContentPartSource.tsx import { useContentPart } from "../../context/react/ContentPartContext.mjs"; var useContentPartSource = () => { const source = useContentPart((c) => { if (c.type !== "source") throw new Error( "ContentPartSource can only be used inside source content parts." ); return c; }); return source; }; export { useContentPartSource }; //# sourceMappingURL=useContentPartSource.mjs.map