@assistant-ui/react
Version:
React components for AI chat.
16 lines • 463 B
JavaScript
// src/primitive-hooks/contentPart/useContentPartImage.tsx
import { useContentPart } from "../../context/react/ContentPartContext.mjs";
var useContentPartImage = () => {
const image = useContentPart((c) => {
if (c.type !== "image")
throw new Error(
"ContentPartImage can only be used inside image content parts."
);
return c;
});
return image;
};
export {
useContentPartImage
};
//# sourceMappingURL=useContentPartImage.mjs.map