Skip to content

Commit

Permalink
refactor: update playground text runtime usage (#875)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonom authored Sep 22, 2024
1 parent 3970adc commit 2b81a63
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { TextContentPartComponent, useMessageStore } from "@assistant-ui/react";
import TextareaAutosize from "react-textarea-autosize";
import { useGetPlaygroundRuntime } from "../../../lib/usePlaygroundRuntime";
import { usePlaygroundRuntime } from "../../../lib/usePlaygroundRuntime";

export const Text: TextContentPartComponent = ({ part }) => {
const getPlaygroundRuntime = useGetPlaygroundRuntime();
const runtime = usePlaygroundRuntime();
const messageStore = useMessageStore();
const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
try {
getPlaygroundRuntime().setMessageText({
runtime.setMessageText({
messageId: messageStore.getState().message.id,
contentPart: part,
text: e.target.value,
Expand Down

0 comments on commit 2b81a63

Please sign in to comment.