/** * CarouselSettingsSection * * Settings for carousel element type. * Manages carousel slides with images and captions. */ import React from 'react'; import { mdiPlus, mdiTrashCan } from '@mdi/js'; import BaseButton from '../BaseButton'; import CardBox from '../CardBox'; import FormField from '../FormField'; import type { CarouselSettingsSectionProps } from './types'; import { FONT_OPTIONS } from '../../lib/fonts'; const CarouselSettingsSection: React.FC = ({ carouselPrevIconUrl, carouselNextIconUrl, carouselCaptionFontFamily, carouselSlides, onAddSlide, onRemoveSlide, onUpdateSlide, onChange, context, iconAssetOptions = [], imageAssetOptions = [], }) => { const isConstructor = context === 'constructor'; return (

Carousel settings

{isConstructor ? ( <> ) : ( <> onChange('carouselPrevIconUrl', event.target.value) } /> onChange('carouselNextIconUrl', event.target.value) } /> )}
{/* Slides editor only shown in constructor - slides are instance-specific */} {isConstructor && ( <>

Carousel slides

{carouselSlides.length === 0 ? (

No slides yet.

) : ( carouselSlides.map((slide, index) => (

Slide {index + 1}

onRemoveSlide(slide.id)} />
onUpdateSlide(slide.id, 'caption', event.target.value) } />
)) )}
)}
); }; export default CarouselSettingsSection;