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