import{O as w,j as o,B as n,b as e,q as l,bE as S,aj as y,aI as d,G as f,a1 as T,v as B,w as W,x as c,y as m,z,s as I}from"./index-ktJf6c6X.js";import{B as j}from"./BackIcon-BeFsFiJV.js";const D=({title:C,fields:v,sections:s,setOpen:h,onClose:x})=>{const a=w(),t=a.palette.mode==="dark",b=()=>{x?x():h&&h("ViewTable")};return o(n,{sx:{width:"100%",mx:"auto",py:2,px:{xs:1.5,sm:2}},children:[o(n,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:3,flexWrap:"wrap",gap:1.5},children:[o(n,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e(j,{onClick:b}),e(l,{variant:"h5",fontWeight:700,color:"primary.main",sx:{letterSpacing:"-0.02em",lineHeight:1.3},children:C})]}),e(S,{onClose:b})]}),o(y,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden",borderColor:a.palette.divider,boxShadow:t?"none":"0 1px 3px rgba(0,0,0,0.06)",backgroundColor:a.palette.background.paper},children:[e(n,{sx:{px:2,py:1.25,borderBottom:1,borderColor:"divider",backgroundColor:d(a.palette.primary.main,t?.12:.06)},children:e(l,{variant:"subtitle2",fontWeight:600,color:"primary.main",sx:{textTransform:"uppercase",letterSpacing:"0.06em"},children:"Overview"})}),e(T,{sx:{p:{xs:2,sm:3}},children:e(f,{container:!0,spacing:2,component:"dl",children:v.map((r,p)=>e(f,{item:!0,xs:12,sm:6,md:6,children:o(n,{sx:{display:"flex",alignItems:"flex-start",gap:1.5,p:2,borderRadius:1.5,borderLeft:3,borderLeftColor:r.color||"primary.main",backgroundColor:d(a.palette.primary.main,t?.06:.03),transition:"background-color 0.2s ease, box-shadow 0.2s ease","&:hover":{backgroundColor:d(a.palette.primary.main,t?.1:.06),boxShadow:t?"none":"0 2px 8px rgba(0,0,0,0.04)"}},children:[r.icon&&e(n,{sx:{color:r.color||"primary.main",mt:.25,"& .MuiSvgIcon-root":{fontSize:20}},children:r.icon}),o(n,{sx:{minWidth:0,flex:1},children:[e(l,{component:"dt",variant:"body2",color:"text.secondary",sx:{fontWeight:500,mb:.25,fontSize:"0.8125rem"},children:r.label}),e(l,{component:"dd",variant:"body1",fontWeight:600,sx:{color:"text.primary",fontSize:"0.9375rem",m:0},children:r.value??"—"})]})]})},p))})})]}),s==null?void 0:s.map((r,p)=>{var g;return o(y,{variant:"outlined",sx:{mt:3,borderRadius:2,overflow:"hidden",borderColor:a.palette.divider,boxShadow:t?"none":"0 1px 3px rgba(0,0,0,0.06)",backgroundColor:a.palette.background.paper},children:[e(n,{sx:{px:2,py:1.5,borderBottom:1,borderColor:"divider",backgroundColor:d(a.palette.grey[500],t?.15:.08)},children:e(l,{variant:"subtitle1",fontWeight:600,children:r.title})}),e(I,{children:o(B,{size:"small",stickyHeader:!0,children:[e(W,{children:e(c,{children:r.columns.map(i=>e(m,{sx:{fontWeight:600,fontSize:"0.8125rem",color:"text.secondary",borderBottom:1,borderColor:"divider",py:1.5,px:2},children:i.header},i.field))})}),e(z,{children:(g=r.rows)!=null&&g.length?r.rows.map((i,k)=>e(c,{hover:!0,children:r.columns.map(u=>e(m,{sx:{py:1.5,px:2,fontSize:"0.875rem"},children:(i==null?void 0:i[u.field])??"—"},u.field))},k)):e(c,{children:e(m,{colSpan:r.columns.length,align:"center",sx:{py:4,color:"text.secondary"},children:"No data available"})})})]})})]},p)})]})};export{D as C};
