@assistant-ui/react
Version:
Typescript/React library for AI Chat
18 lines (17 loc) • 473 B
JavaScript
"use client";
// src/primitives/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