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:
parent
24ef4034b6
commit
f1d90110ae
1 changed files with 20 additions and 0 deletions
20
src/frontend/src/shared/components/textOutputView/index.tsx
Normal file
20
src/frontend/src/shared/components/textOutputView/index.tsx
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue