From 68f5b38bd2efb2abc7ce57e92c1901f23522f230 Mon Sep 17 00:00:00 2001 From: ogabrielluiz Date: Wed, 19 Jun 2024 01:02:46 -0300 Subject: [PATCH] refactor: Improve TextOutputView component This commit refactors the TextOutputView component to handle a specific case where the `value` prop is an object with a `text` property. It updates the component to check if the `value` is an object and if it contains the `text` property. If so, it assigns the value of `value.text` to `value`. This change improves the flexibility and usability of the component. --- .../shared/components/textOutputView/index.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/frontend/src/shared/components/textOutputView/index.tsx b/src/frontend/src/shared/components/textOutputView/index.tsx index 60e83692b..0071a654b 100644 --- a/src/frontend/src/shared/components/textOutputView/index.tsx +++ b/src/frontend/src/shared/components/textOutputView/index.tsx @@ -1,14 +1,17 @@ import { Textarea } from "../../../components/ui/textarea"; const TextOutputView = ({ left, value }) => { + if (typeof value === "object" && Object.keys(value).includes("text")) { + value = value.text; + } return ( -