@assistant-ui/react
Version:
TypeScript/React library for AI Chat
18 lines (17 loc) • 501 B
JavaScript
"use client";
// src/primitives/contentPart/useContentPartText.tsx
import { useContentPart } from "../../context/react/ContentPartContext.js";
var useContentPartText = () => {
const text = useContentPart((c) => {
if (c.type !== "text" && c.type !== "reasoning")
throw new Error(
"ContentPartText can only be used inside text or reasoning content parts."
);
return c;
});
return text;
};
export {
useContentPartText
};
//# sourceMappingURL=useContentPartText.js.map