diff --git a/frontend/src/Editor/Components/Image.jsx b/frontend/src/Editor/Components/Image.jsx index f0d5dc0038..92db56dd24 100644 --- a/frontend/src/Editor/Components/Image.jsx +++ b/frontend/src/Editor/Components/Image.jsx @@ -1,41 +1,18 @@ import React from 'react'; -import { resolveReferences, resolveWidgetFieldValue } from '@/_helpers/utils'; import LazyLoad from 'react-lazyload'; -export const Image = function Image({ id, height, component, onComponentClick, currentState }) { - const source = component.definition.properties.source.value; - const widgetVisibility = component.definition.styles?.visibility?.value ?? true; - const disabledState = component.definition.styles?.disabledState?.value ?? false; - - const parsedDisabledState = - typeof disabledState !== 'boolean' ? resolveWidgetFieldValue(disabledState, currentState) : disabledState; - - let data = resolveReferences(source, currentState, null); - - let parsedWidgetVisibility = widgetVisibility; - - try { - parsedWidgetVisibility = resolveReferences(parsedWidgetVisibility, currentState, []); - } catch (err) { - console.log(err); - } - if (data === '') data = null; +export const Image = function Image({ height, properties, styles }) { + const source = properties.source; + const widgetVisibility = styles.visibility ?? true; function Placeholder() { return
; } return ( -