import React from 'react'; import { useBlockProps, InnerBlocks } from '@wordpress/block-editor'; interface SaveProps { attributes: { type: string; navigationType: string; navigationPlacement: string; navigationOpacity: number; navigationBgColor: string; navigationShape: string; navigationSize: string; navigationColor: string; navigationVerticalPosition: number; navigationHorizontalPosition: number; dotColor: string; dotActiveColor: string; transitionEffect: 'slide' | 'fade' | 'zoom'; transitionDuration: number; transitionEasing: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'; autoplay: boolean; autoplaySpeed: number; pauseOnHover: boolean; widthPreset: string; customWidth: string; widthUnit?: string; }; } export const Save: React.FC = ({ attributes }) => { // Custom width logic for frontend const customWidthStyle = attributes.widthPreset === 'custom' && attributes.customWidth ? { '--sliderberg-custom-width': `${attributes.customWidth}px` } as React.CSSProperties : {}; const blockProps = useBlockProps.save({ style: { '--sliderberg-dot-color': attributes.dotColor, '--sliderberg-dot-active-color': attributes.dotActiveColor, ...customWidthStyle }, 'data-width-preset': attributes.widthPreset }); return (
{attributes.navigationType === 'top' && (
{/* Slide indicators will be added dynamically via JavaScript or server-side rendering */}
)}
{attributes.navigationType === 'split' && ( <>
{/* Slide indicators will be added dynamically via JavaScript or server-side rendering */}
)}
{attributes.navigationType === 'bottom' && (
{/* Slide indicators will be added dynamically via JavaScript or server-side rendering */}
)}
); };