import{r as i,j as o,I as n,B as g}from"./index-6fe66247.js";import{d as b}from"./Close-6b8f340d.js";import{d as p}from"./ArrowBackIos-3464faa2.js";import{d as u}from"./ArrowForwardIos-faa65ed1.js";import{D as f}from"./Dialog-649880d3.js";import{D as m}from"./DialogContent-24cef02f.js";const k=({open:c,images:t,initialIndex:e,onClose:h})=>{const[s,l]=i.useState(e);i.useEffect(()=>{l(e)},[e]);const x=()=>{l(r=>r>0?r-1:t.length-1)},d=()=>{l(r=>r<t.length-1?r+1:0)},a=()=>{h()};return o.jsx(f,{open:c,onClose:a,maxWidth:"md",fullWidth:!0,children:o.jsxs(m,{sx:{p:1,position:"relative"},children:[o.jsx(n,{onClick:a,sx:{position:"absolute",top:8,right:8,zIndex:1,bgcolor:"rgba(0,0,0,0.5)",color:"white","&:hover":{bgcolor:"rgba(0,0,0,0.7)"}},children:o.jsx(b,{})}),t.length>1&&o.jsxs(o.Fragment,{children:[o.jsx(n,{onClick:x,sx:{position:"absolute",left:8,top:"50%",transform:"translateY(-50%)",zIndex:1,bgcolor:"rgba(0,0,0,0.5)",color:"white","&:hover":{bgcolor:"rgba(0,0,0,0.7)"}},children:o.jsx(p,{})}),o.jsx(n,{onClick:d,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",zIndex:1,bgcolor:"rgba(0,0,0,0.5)",color:"white","&:hover":{bgcolor:"rgba(0,0,0,0.7)"}},children:o.jsx(u,{})})]}),o.jsx("img",{src:t[s],alt:`Attachment ${s+1}`,style:{width:"100%",height:"auto",borderRadius:"8px"}}),t.length>1&&o.jsxs(g,{sx:{position:"absolute",bottom:16,left:"50%",transform:"translateX(-50%)",bgcolor:"rgba(0,0,0,0.5)",color:"white",px:2,py:1,borderRadius:1,fontSize:"14px"},children:[s+1," / ",t.length]})]})})};export{k as I};
