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:
parent
d4a3e83e80
commit
68f5b38bd2
1 changed files with 10 additions and 7 deletions
|
|
@ -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"}`}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue