diff --git a/components/ComponentPreview.vue b/components/ComponentPreview.vue index a138c07..ca0b492 100644 --- a/components/ComponentPreview.vue +++ b/components/ComponentPreview.vue @@ -32,7 +32,8 @@ :accept="component.props.accept || undefined" :max="component.props.max || undefined" :mask="component.props.mask || undefined" :digits="component.props.digits || undefined" :multiple="component.props.multiple || undefined" :maxSize="component.props.maxSize || undefined" - :maxFiles="component.props.maxFiles || undefined" :classes="component.type === 'checkbox' ? { + :maxFiles="component.props.maxFiles || undefined" :rows="component.type === 'textarea' ? (component.props.rows || 3) : undefined" + :classes="component.type === 'checkbox' ? { wrapper: 'mb-1', options: 'space-y-0.5' } : {}" :class="{ @@ -335,7 +336,21 @@ {{ component.props.label }} - + + + {{ component.props.buttonText || component.props.label || 'Button' }} + + + + + + {{ component.props.buttonText || component.props.label || 'Button' }} @@ -1245,6 +1260,24 @@ const saveNestedComponentSettings = (updatedComponent) => { // Close the modal closeNestedSettingsModal(); }; + +// Button link functionality +const getButtonLink = () => { + if (!props.component || props.component.type !== 'button') return null; + + const { linkType, linkUrl, linkProcessId, linkTarget } = props.component.props; + + if (linkType === 'url' && linkUrl) { + return linkUrl; + } + + if (linkType === 'process' && linkProcessId) { + // Generate the process workflow URL + return `${window.location.origin}/workflow/${linkProcessId}`; + } + + return null; +};