✨ (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:
parent
6bbb3688ee
commit
395fbad81a
3 changed files with 12 additions and 3 deletions
|
|
@ -27,7 +27,7 @@ export default function SwitchOutputView(nodeId): JSX.Element {
|
||||||
</Case>
|
</Case>
|
||||||
|
|
||||||
<Case condition={node && checkType() === "object"}>
|
<Case condition={node && checkType() === "object"}>
|
||||||
<TextOutputView left={false} flowPool={flowPool} node={node} />
|
<TextOutputView left={false} flowPool={flowPool} node={node} vaç />
|
||||||
</Case>
|
</Case>
|
||||||
|
|
||||||
<Case condition={node && Array.isArray(results)}>
|
<Case condition={node && Array.isArray(results)}>
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,10 @@ export default function IOFieldView({
|
||||||
|
|
||||||
const [errorDuplicateKey, setErrorDuplicateKey] = useState(false);
|
const [errorDuplicateKey, setErrorDuplicateKey] = useState(false);
|
||||||
|
|
||||||
|
const textOutputValue =
|
||||||
|
(flowPool[node!.id] ?? [])[(flowPool[node!.id]?.length ?? 1) - 1]?.data
|
||||||
|
.results.result ?? "";
|
||||||
|
|
||||||
function handleOutputType() {
|
function handleOutputType() {
|
||||||
if (!node) return <>"No node found!"</>;
|
if (!node) return <>"No node found!"</>;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
@ -158,7 +162,12 @@ export default function IOFieldView({
|
||||||
switch (fieldType) {
|
switch (fieldType) {
|
||||||
case "TextOutput":
|
case "TextOutput":
|
||||||
return (
|
return (
|
||||||
<TextOutputView left={left} node={node} flowPool={flowPool} />
|
<TextOutputView
|
||||||
|
left={left}
|
||||||
|
node={node}
|
||||||
|
flowPool={flowPool}
|
||||||
|
value={textOutputValue}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
case "PDFOutput":
|
case "PDFOutput":
|
||||||
return left ? (
|
return left ? (
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Textarea } from "../../../components/ui/textarea";
|
import { Textarea } from "../../../components/ui/textarea";
|
||||||
|
|
||||||
const TextOutputView = ({ left, node, flowPool }) => {
|
const TextOutputView = ({ left, node, flowPool, value }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Textarea
|
<Textarea
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue