(index.tsx): add value prop to TextOutputView component to display text output value

🐛 (index.tsx): fix typo in TextOutputView component usage
This commit is contained in:
cristhianzl 2024-05-30 11:00:03 -03:00
commit 395fbad81a
3 changed files with 12 additions and 3 deletions

View file

@ -27,7 +27,7 @@ export default function SwitchOutputView(nodeId): JSX.Element {
</Case>
<Case condition={node && checkType() === "object"}>
<TextOutputView left={false} flowPool={flowPool} node={node} />
<TextOutputView left={false} flowPool={flowPool} node={node} vaç />
</Case>
<Case condition={node && Array.isArray(results)}>

View file

@ -45,6 +45,10 @@ export default function IOFieldView({
const [errorDuplicateKey, setErrorDuplicateKey] = useState(false);
const textOutputValue =
(flowPool[node!.id] ?? [])[(flowPool[node!.id]?.length ?? 1) - 1]?.data
.results.result ?? "";
function handleOutputType() {
if (!node) return <>"No node found!"</>;
switch (type) {
@ -158,7 +162,12 @@ export default function IOFieldView({
switch (fieldType) {
case "TextOutput":
return (
<TextOutputView left={left} node={node} flowPool={flowPool} />
<TextOutputView
left={left}
node={node}
flowPool={flowPool}
value={textOutputValue}
/>
);
case "PDFOutput":
return left ? (

View file

@ -1,6 +1,6 @@
import { Textarea } from "../../../components/ui/textarea";
const TextOutputView = ({ left, node, flowPool }) => {
const TextOutputView = ({ left, node, flowPool, value }) => {
return (
<>
<Textarea