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.
This commit is contained in:
ogabrielluiz 2024-06-19 01:02:46 -03:00
commit 68f5b38bd2

View file

@ -1,6 +1,9 @@
import { Textarea } from "../../../components/ui/textarea"; import { Textarea } from "../../../components/ui/textarea";
const TextOutputView = ({ left, value }) => { const TextOutputView = ({ left, value }) => {
if (typeof value === "object" && Object.keys(value).includes("text")) {
value = value.text;
}
return ( return (
<Textarea <Textarea
className={`w-full custom-scroll ${left ? "min-h-32" : "h-full"}`} className={`w-full custom-scroll ${left ? "min-h-32" : "h-full"}`}