feat: Add TextOutputView component for displaying text output

This commit adds a new component called TextOutputView to the shared/components directory. The TextOutputView component is responsible for displaying text output in a textarea. It receives the necessary data from the flowPool and renders the appropriate text. This component improves the code organization and reusability of the text output display logic.
This commit is contained in:
cristhianzl 2024-05-28 12:16:47 -03:00
commit f1d90110ae

View file

@ -0,0 +1,20 @@
import { Textarea } from "../../../components/ui/textarea";
const TextOutputView = ({ left, node, flowPool }) => {
return (
<>
<Textarea
className={`w-full custom-scroll ${left ? " min-h-32" : " h-full"}`}
placeholder={"Empty"}
// update to real value on flowPool
value={
(flowPool[node.id] ?? [])[(flowPool[node.id]?.length ?? 1) - 1]?.data
.results.result ?? ""
}
readOnly
/>
</>
);
};
export default TextOutputView;