@nexusui/components
Version:
These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.
3 lines (2 loc) • 892 B
JavaScript
"use client";
import{jsxs as e,Fragment as l,jsx as i}from"react/jsx-runtime";import{useState as r}from"react";import t from"@mui/material/Dialog";import{ImageCarouselComponent as a,prefix as o}from"./ImageCarousel.component.js";const n=n=>{const{allowFullScreen:c=!1,onToggleFullScreen:g,onActiveStepChange:u,fullScreenDialogProps:m={},initialActiveStep:s=0,images:S}=n,d=S.length,[p,f]=r(!1),[h,F]=r(s<0?0:s>d-1?d-1:s),b=()=>{f((e=>!e)),g?.(!p)};return e(l,{children:[i(a,{...n,isFullScreen:p,onToggleFullScreen:b,onActiveStepChange:(e,l)=>{F(e),u?.(e,l)}}),c?p&&i(t,{"aria-describedby":`${o}-full-screen-dialog`,"aria-labelledby":"image carousel dialog","data-testid":`${o}-fullScreenDialog`,maxWidth:!1,fullScreen:!0,...m,open:p,children:i(a,{...n,"data-testid":`${o}-fullScreen`,isFullScreen:p,onToggleFullScreen:b,initialActiveStep:h})}):""]})};export{n as ImageCarousel,n as default};