umwd-components 0.1.746 → 0.1.748
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/components/layout/NavbarV2.js +1 -1
- package/dist/cjs/src/components/public-information/PublicInformationForm.js +1 -1
- package/dist/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/src/components/layout/NavbarV2.js +3 -1
- package/dist/esm/src/components/public-information/PublicInformationForm.js +2 -2
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("next/image"),i=require("@mui/material/Dialog"),s=require("@mui/material/AppBar"),l=require("@mui/material/Box"),n=require("@mui/material/Toolbar"),a=require("@mui/material/Typography"),x=require("@mui/material/Container"),o=require("@mui/material/Button"),d=require("@mui/material/List"),h=require("@mui/material/ListItem"),c=require("@mui/material/Divider"),m=require("@mui/material/ListItemText"),p=require("@mui/material/Tabs"),u=require("@mui/material/Tab"),g=require("@mui/icons-material/Close"),j=require("@mui/icons-material/MoreVert"),y=require("@mui/material/styles"),f=require("../StyledLink.js");exports.default=function({data:b}){const{site_title:w,logo:v,navigation:q,maxWidth:T="lg",minHeight:I,sx:k={},home_url:S="/#home",slot1:L=null,slot2:F=null}=b,[D,_]=t.useState(!1),[C,W]=t.useState(0),G=()=>{_(!1)},H=y.useTheme();return t.useEffect(()=>{const e=()=>{const e=document.querySelectorAll("section"),t=window.scrollY+1;e.forEach((e,r)=>{t>=e.offsetTop&&t<e.offsetTop+e.offsetHeight&&W(r)})};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),e.jsx(s,{position:"sticky",sx:{backgroundColor:H.palette.primary.main,...k},children:e.jsx(x,{maxWidth:T,children:e.jsxs(n,{disableGutters:!0,sx:{py:1,"@media all":{minHeight:I}},children:[e.jsx(f.StyledLink,{href:S,sx:{color:H.palette.primary.contrastText,textDecoration:"none",lineHeight:.51},target:"_self",children:e.jsxs(l,{sx:{display:{xs:"none",md:"flex"},alignItems:"center"},children:[void 0!==v?.url&&e.jsx(r,{src:v.url,width:v.width||32,height:v.height||32,alt:v.alternativeText||"site logo",style:{maxHeight:"55px",marginRight:"20px",width:"auto",height:"auto",...v.style}}),null!=w&&e.jsx(e.Fragment,{children:"string"==typeof w?e.jsx(a,{variant:"h6",noWrap:!0,component:"h1",sx:{display:"flex",textDecoration:"none",p:0},children:w}):e.jsx(e.Fragment,{children:w})})]})}),e.jsx(l,{sx:{display:{xs:"none",md:"flex"},width:{xs:"0px",md:"30px"}}}),e.jsx(l,{sx:{flexGrow:1,display:{xs:"none",md:"flex",alignItems:"center"}},children:e.jsx(p,{value:C,"aria-label":"main website navigation",indicatorColor:"secondary",role:"navigation",children:q.length>0&&q.map((t,r)=>e.jsx(u,{value:t.tab,label:e.jsxs(e.Fragment,{children:[e.jsx(f.StyledLink,{href:t.path,sx:{color:H.palette.primary.contrastText},target:"_self",children:t.title}),t.subItems&&t.subItems.length>0&&t.subItems.map((t,r)=>{const i=50+50*r;return e.jsx(l,{sx:{position:"fixed"},children:e.jsx(l,{sx:{position:"absolute",top:i},children:e.jsx(f.StyledLink,{href:t.path,target:"_self",children:e.jsx(a,{className:"nested",variant:"button",textAlign:"center",sx:{display:"block",position:"absolute",top:"-1000px",transform:"translateX(-50%)",color:H.palette.primary.contrastText,transitionDuration:"0.5s",transitionDelay:"0.5s",width:"max-content","&:hover":{borderBottom:"1px solid red"}},children:t.title})})},`${t.documentId}-inner`)},t.documentId)})]}),sx:{color:H.palette.primary.contrastText,opacity:.9,position:"relative",overflow:"visible",display:"flex",flexDirection:"column","& .nested":{p:0},"&:hover":{".nested":{top:"0px"}}}},t.documentId))})}),e.jsx(f.StyledLink,{href:"/",sx:{color:H.palette.primary.contrastText,textDecoration:"none"},target:"_self",children:e.jsxs(l,{sx:{display:{xs:"flex",md:"none"},alignItems:"center"},children:[void 0!==v?.url&&e.jsx(l,{sx:{display:"flex",mr:1},children:e.jsx("img",{src:v.url,width:v.width||32,height:v.height||32,alt:v.alternativeText||"site logo",style:{maxHeight:"55px",width:"auto",height:"auto",...v.style}})}),null!=w&&e.jsx(e.Fragment,{children:"string"==typeof w?e.jsx(a,{variant:"h5",noWrap:!0,component:"h1",sx:{display:"flex",flexGrow:1,textDecoration:"none"},children:w}):e.jsx(e.Fragment,{children:w})})]})}),e.jsx(l,{sx:{display:{xs:"flex"},flexGrow:1}}),L&&e.jsx(l,{sx:{display:{xs:"none",md:"flex"},mr:2},children:L}),F&&e.jsx(l,{sx:{display:{xs:"none",md:"flex"},mr:2},children:F}),e.jsxs(l,{sx:{flexGrow:0,display:{xs:"flex",md:"none"}},children:[e.jsx(o,{onClick:()=>{_(!0)},sx:{width:"40px",height:"40px",borderRadius:"50%",p:0,minWidth:"unset",color:"primary.contrastText",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},children:e.jsx(j,{sx:{color:"primary.contrastText"}})}),e.jsxs(i,{fullScreen:!0,open:D,onClose:G,children:[e.jsx(s,{position:"sticky",children:e.jsx(x,{maxWidth:"xl",children:e.jsxs(n,{disableGutters:!0,sx:{py:1,justifyContent:"space-between"},children:[e.jsx(f.StyledLink,{href:"/",sx:{color:H.palette.primary.contrastText},target:"_self",children:e.jsxs(l,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[v?.url&&e.jsx(l,{sx:{display:"flex",mr:1},children:e.jsx("img",{src:v.url,alt:v.alternativeText||"logo",width:v.width||32,height:v.height||32,style:{maxHeight:"55px",width:"auto",height:"auto"}})}),null!=w&&e.jsx(e.Fragment,{children:"string"==typeof w?e.jsx(a,{variant:"h5",noWrap:!0,component:"h1",sx:{display:"flex",flexGrow:1,textDecoration:"none"},children:w}):e.jsx(e.Fragment,{children:w})})]})}),e.jsx(o,{onClick:G,sx:{width:"40px",height:"40px",borderRadius:"50%",p:0,minWidth:"unset",color:"primary.contrastText",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},"aria-label":"close",children:e.jsx(g,{sx:{color:"primary.contrastText"}})})]})})}),e.jsxs(d,{children:[q.length>0&&e.jsx(e.Fragment,{children:q.map(r=>e.jsxs(t.Fragment,{children:[e.jsx(f.StyledLink,{href:r.path,target:"_self",children:e.jsx(h,{children:e.jsx(m,{primary:r.title})})}),e.jsx(c,{}),r.subItems&&r.subItems.length>0&&e.jsx(d,{children:r.subItems.map(r=>e.jsxs(t.Fragment,{children:[e.jsx(f.StyledLink,{href:r.path,target:"_self",children:e.jsx(h,{children:e.jsx(m,{primary:r.title})})}),e.jsx(c,{})]},r.documentId))})]},r.documentId))}),L&&e.jsxs(e.Fragment,{children:[e.jsx(h,{children:L}),e.jsx(c,{})]}),F&&e.jsxs(e.Fragment,{children:[e.jsx(h,{children:F}),e.jsx(c,{})]})]})]})]})]})})})};
|
|
7
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("next/image"),i=require("@mui/material/Dialog"),s=require("@mui/material/AppBar"),l=require("@mui/material/Box"),n=require("@mui/material/Toolbar"),a=require("@mui/material/Typography"),x=require("@mui/material/Container"),o=require("@mui/material/Button"),d=require("@mui/material/List"),h=require("@mui/material/ListItem"),c=require("@mui/material/Divider"),m=require("@mui/material/ListItemText"),p=require("@mui/material/Tabs"),u=require("@mui/material/Tab"),g=require("@mui/icons-material/Close"),j=require("@mui/icons-material/MoreVert"),y=require("@mui/material/styles"),f=require("../StyledLink.js");exports.default=function({data:b}){const{site_title:w,logo:v,navigation:q,maxWidth:T="lg",minHeight:I,sx:k={},home_url:S="/#home",slot1:L=null,slot2:F=null}=b,[D,_]=t.useState(!1),[C,W]=t.useState(0),G=()=>{_(!1)},H=y.useTheme();return t.useEffect(()=>{const e=()=>{const e=document.querySelectorAll("section"),t=window.scrollY+1;e.forEach((e,r)=>{t>=e.offsetTop&&t<e.offsetTop+e.offsetHeight&&r<q.length&&W(r)})};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),e.jsx(s,{position:"sticky",sx:{backgroundColor:H.palette.primary.main,...k},children:e.jsx(x,{maxWidth:T,children:e.jsxs(n,{disableGutters:!0,sx:{py:1,"@media all":{minHeight:I}},children:[e.jsx(f.StyledLink,{href:S,sx:{color:H.palette.primary.contrastText,textDecoration:"none",lineHeight:.51},target:"_self",children:e.jsxs(l,{sx:{display:{xs:"none",md:"flex"},alignItems:"center"},children:[void 0!==v?.url&&e.jsx(r,{src:v.url,width:v.width||32,height:v.height||32,alt:v.alternativeText||"site logo",style:{maxHeight:"55px",marginRight:"20px",width:"auto",height:"auto",...v.style}}),null!=w&&e.jsx(e.Fragment,{children:"string"==typeof w?e.jsx(a,{variant:"h6",noWrap:!0,component:"h1",sx:{display:"flex",textDecoration:"none",p:0},children:w}):e.jsx(e.Fragment,{children:w})})]})}),e.jsx(l,{sx:{display:{xs:"none",md:"flex"},width:{xs:"0px",md:"30px"}}}),e.jsx(l,{sx:{flexGrow:1,display:{xs:"none",md:"flex",alignItems:"center"}},children:e.jsx(p,{value:C,"aria-label":"main website navigation",indicatorColor:"secondary",role:"navigation",children:q.length>0&&q.map((t,r)=>e.jsx(u,{value:t.tab,label:e.jsxs(e.Fragment,{children:[e.jsx(f.StyledLink,{href:t.path,sx:{color:H.palette.primary.contrastText},target:"_self",children:t.title}),t.subItems&&t.subItems.length>0&&t.subItems.map((t,r)=>{const i=50+50*r;return e.jsx(l,{sx:{position:"fixed"},children:e.jsx(l,{sx:{position:"absolute",top:i},children:e.jsx(f.StyledLink,{href:t.path,target:"_self",children:e.jsx(a,{className:"nested",variant:"button",textAlign:"center",sx:{display:"block",position:"absolute",top:"-1000px",transform:"translateX(-50%)",color:H.palette.primary.contrastText,transitionDuration:"0.5s",transitionDelay:"0.5s",width:"max-content","&:hover":{borderBottom:"1px solid red"}},children:t.title})})},`${t.documentId}-inner`)},t.documentId)})]}),sx:{color:H.palette.primary.contrastText,opacity:.9,position:"relative",overflow:"visible",display:"flex",flexDirection:"column","& .nested":{p:0},"&:hover":{".nested":{top:"0px"}}}},t.documentId))})}),e.jsx(f.StyledLink,{href:"/",sx:{color:H.palette.primary.contrastText,textDecoration:"none"},target:"_self",children:e.jsxs(l,{sx:{display:{xs:"flex",md:"none"},alignItems:"center"},children:[void 0!==v?.url&&e.jsx(l,{sx:{display:"flex",mr:1},children:e.jsx("img",{src:v.url,width:v.width||32,height:v.height||32,alt:v.alternativeText||"site logo",style:{maxHeight:"55px",width:"auto",height:"auto",...v.style}})}),null!=w&&e.jsx(e.Fragment,{children:"string"==typeof w?e.jsx(a,{variant:"h5",noWrap:!0,component:"h1",sx:{display:"flex",flexGrow:1,textDecoration:"none"},children:w}):e.jsx(e.Fragment,{children:w})})]})}),e.jsx(l,{sx:{display:{xs:"flex"},flexGrow:1}}),L&&e.jsx(l,{sx:{display:{xs:"none",md:"flex"},mr:2},children:L}),F&&e.jsx(l,{sx:{display:{xs:"none",md:"flex"},mr:2},children:F}),e.jsxs(l,{sx:{flexGrow:0,display:{xs:"flex",md:"none"}},children:[e.jsx(o,{onClick:()=>{_(!0)},sx:{width:"40px",height:"40px",borderRadius:"50%",p:0,minWidth:"unset",color:"primary.contrastText",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},children:e.jsx(j,{sx:{color:"primary.contrastText"}})}),e.jsxs(i,{fullScreen:!0,open:D,onClose:G,children:[e.jsx(s,{position:"sticky",children:e.jsx(x,{maxWidth:"xl",children:e.jsxs(n,{disableGutters:!0,sx:{py:1,justifyContent:"space-between"},children:[e.jsx(f.StyledLink,{href:"/",sx:{color:H.palette.primary.contrastText},target:"_self",children:e.jsxs(l,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[v?.url&&e.jsx(l,{sx:{display:"flex",mr:1},children:e.jsx("img",{src:v.url,alt:v.alternativeText||"logo",width:v.width||32,height:v.height||32,style:{maxHeight:"55px",width:"auto",height:"auto"}})}),null!=w&&e.jsx(e.Fragment,{children:"string"==typeof w?e.jsx(a,{variant:"h5",noWrap:!0,component:"h1",sx:{display:"flex",flexGrow:1,textDecoration:"none"},children:w}):e.jsx(e.Fragment,{children:w})})]})}),e.jsx(o,{onClick:G,sx:{width:"40px",height:"40px",borderRadius:"50%",p:0,minWidth:"unset",color:"primary.contrastText",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},"aria-label":"close",children:e.jsx(g,{sx:{color:"primary.contrastText"}})})]})})}),e.jsxs(d,{children:[q.length>0&&e.jsx(e.Fragment,{children:q.map(r=>e.jsxs(t.Fragment,{children:[e.jsx(f.StyledLink,{href:r.path,target:"_self",children:e.jsx(h,{children:e.jsx(m,{primary:r.title})})}),e.jsx(c,{}),r.subItems&&r.subItems.length>0&&e.jsx(d,{children:r.subItems.map(r=>e.jsxs(t.Fragment,{children:[e.jsx(f.StyledLink,{href:r.path,target:"_self",children:e.jsx(h,{children:e.jsx(m,{primary:r.title})})}),e.jsx(c,{})]},r.documentId))})]},r.documentId))}),L&&e.jsxs(e.Fragment,{children:[e.jsx(h,{children:L}),e.jsx(c,{})]}),F&&e.jsxs(e.Fragment,{children:[e.jsx(h,{children:F}),e.jsx(c,{})]})]})]})]})]})})})};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
"use strict";var e=require("react/jsx-runtime"),i=require("@mui/material/Divider"),s=require("@mui/material/Paper"),a=require("@mui/material/Box"),n=require("@mui/material/Stack"),r=require("@mui/material/Alert"),t=require("@mui/material/TextField"),l=require("@mui/material/Typography"),o=require("@mui/material/Grid"),c=require("../SubmitButton.js"),d=require("react"),m=require("../StrapiErrors.js"),u=require("../e-commerce/customer/BusinessCredentials.js"),p=require("../common/Address.js"),x=require("../../data/actions/public-information/updatePublicInformationAction.js"),j=require("../common/socials/Socials.js"),h=require("@mui/material/IconButton"),g=require("@mui/icons-material/Add");const f={zodErrors:null,strapiErrors:null,data:null,message:null};exports.PublicInformationForm=function({publicInformation:b,sx:q}){const{documentId:v,title:y,description:S,disclaimer_link:z,privacypolicy_link:I,maxWidth:A,email:_,phone_number:C,business_credentials:N,address:$,socials:k,header_logo:B,footer_logo:E}=b;console.log(k);const[F,R]=d.useActionState((e,i)=>x.updatePublicInformationAction(v,e,i),f),[P,T]=d.useState([]),V=(e,i)=>{P.includes(i)?T(P.filter(e=>e!==i)):T([...P,i])},[D,w]=d.useState(k.reduce((e,i,s)=>(e.push({data:i,componentName:`socials[${s}]`,componentReference:"common.social"}),e),[])),[G,W]=d.useState([]);return e.jsx(a,{sx:[{p:2},...Array.isArray(q)?q:[q]],component:s,children:e.jsx("form",{action:R,children:e.jsxs(o,{container:!0,spacing:2,children:[e.jsx(o,{size:12,children:e.jsx(l,{variant:"h5",children:"Edit Public Information"})}),e.jsx(o,{size:12,children:e.jsxs(n,{spacing:2,children:[e.jsx(t,{id:"title",name:"title",label:"Title",defaultValue:y}),e.jsx(t,{id:"description",name:"description",label:"Description",defaultValue:S}),e.jsx(t,{id:"email",name:"email",label:"email",defaultValue:_}),e.jsx(t,{id:"phone_number",name:"phone_number",label:"phone_number",defaultValue:C})]})}),e.jsx(o,{size:{xs:12,lg:6},children:e.jsxs(n,{spacing:2,children:[e.jsx(l,{variant:"h6",children:"Company Address"}),e.jsx(i,{}),e.jsx(p.AddressFields,{componentName:"address",componentReference:"common.address",data:$})]})}),e.jsx(o,{size:{xs:12,lg:6},children:e.jsxs(n,{spacing:2,children:[e.jsx(l,{variant:"h6",children:"Business Credentials"}),e.jsx(i,{}),e.jsx(u.BusinessCredentialsFields,{componentName:"business_credentials",componentReference:"business.credentials",data:N})]})}),e.jsx(o,{sx:{mt:1},size:12,children:e.jsx(l,{variant:"h6",children:"Socials"})}),D.map((i,s)=>i.data?.name?P.includes(i.data.name)?e.jsx(o,{size:{xs:12,md:6,lg:4},children:e.jsx(j.SocialsFields,{data:i.data,componentName:`socials[${s}]`,componentReference:"common.social",deleteCallback:()=>{w(D.filter((e,i)=>i!==s))}})},s):e.jsxs(o,{size:{xs:12,md:6,lg:4},children:[e.jsx("input",{type:"hidden",name:`socials[${s}].documentId`,value:i.data.documentId}),e.jsx("input",{type:"hidden",name:`socials[${s}].name`,value:i.data.name}),e.jsx("input",{type:"hidden",name:`socials[${s}].url`,value:i.data.url}),e.jsx("input",{type:"hidden",name:`socials[${s}].icon`,value:i.data.icon}),e.jsx(j.default,{data:{...i.data,onClick:V}})]},s):null),G.map((i,s)=>e.jsx(o,{size:{xs:12,md:6,lg:4},children:e.jsx(j.SocialsFields,{data:i.data,componentName:i.componentName,componentReference:"common.social",deleteCallback:()=>{W(G.filter((e,i)=>i!==s).map((e,i)=>({...e,componentName:`socials[${i+D.length}]`})))}})},i.data?.uuid)),e.jsx(o,{justifyContent:"center",alignItems:"center",size:{xs:12,md:6,lg:4},children:e.jsx(h,{onClick:()=>{W([...G,{componentName:`socials[${D.length+G.length}]`,componentReference:"logistics-elements.social",data:{name:"",url:""}}])},children:e.jsx(g,{})})}),e.jsx(o,{size:12,children:e.jsxs(n,{direction:"row-reverse",spacing:2,alignItems:"center",sx:{py:1},children:[e.jsx(c.SubmitButton,{text:"save changes",loadingText:"loading"}),F?.strapiErrors&&e.jsx(m.StrapiErrors,{error:F?.strapiErrors}),F?.message&&e.jsx(r,{severity:"error",children:F?.message})]})})]})})})};
|
|
7
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("@mui/material/Divider"),s=require("@mui/material/Paper"),a=require("@mui/material/Box"),n=require("@mui/material/Stack"),r=require("@mui/material/Alert"),t=require("@mui/material/TextField"),l=require("@mui/material/Typography"),o=require("@mui/material/Grid"),c=require("../SubmitButton.js"),d=require("react"),m=require("../StrapiErrors.js"),u=require("../e-commerce/customer/BusinessCredentials.js"),p=require("../common/Address.js"),x=require("../../data/actions/public-information/updatePublicInformationAction.js"),j=require("../common/socials/Socials.js"),h=require("@mui/material/IconButton"),g=require("@mui/icons-material/Add");const f={zodErrors:null,strapiErrors:null,data:null,message:null};exports.PublicInformationForm=function({publicInformation:b,sx:q}){const{documentId:v,title:y,description:S,disclaimer_link:z,privacypolicy_link:I,maxWidth:A,email:_,phone_number:C,business_credentials:N,address:$,socials:k,header_logo:B,footer_logo:E}=b;console.log(k);const[F,R]=d.useActionState((e,i)=>x.updatePublicInformationAction(v,e,i),f),[P,T]=d.useState([]),V=(e,i)=>{P.includes(i)?T(P.filter(e=>e!==i)):T([...P,i])},[D,w]=d.useState(k.reduce((e,i,s)=>(e.push({data:i,componentName:`socials[${s}]`,componentReference:"common.social"}),e),[])),[G,W]=d.useState([]);return e.jsx(a,{sx:[{p:2},...Array.isArray(q)?q:[q]],component:s,children:e.jsx("form",{action:R,children:e.jsxs(o,{container:!0,spacing:2,children:[e.jsx(o,{size:12,children:e.jsx(l,{variant:"h5",children:"Edit Public Information"})}),e.jsx(o,{size:12,children:e.jsxs(n,{spacing:2,children:[e.jsx(t,{id:"title",name:"title",label:"Title",defaultValue:y||""}),e.jsx(t,{id:"description",name:"description",label:"Description",defaultValue:S||""}),e.jsx(t,{id:"email",name:"email",label:"email",defaultValue:_||""}),e.jsx(t,{id:"phone_number",name:"phone_number",label:"phone_number",defaultValue:C||""})]})}),e.jsx(o,{size:{xs:12,lg:6},children:e.jsxs(n,{spacing:2,children:[e.jsx(l,{variant:"h6",children:"Company Address"}),e.jsx(i,{}),e.jsx(p.AddressFields,{componentName:"address",componentReference:"common.address",data:$})]})}),e.jsx(o,{size:{xs:12,lg:6},children:e.jsxs(n,{spacing:2,children:[e.jsx(l,{variant:"h6",children:"Business Credentials"}),e.jsx(i,{}),e.jsx(u.BusinessCredentialsFields,{componentName:"business_credentials",componentReference:"business.credentials",data:N})]})}),e.jsx(o,{sx:{mt:1},size:12,children:e.jsx(l,{variant:"h6",children:"Socials"})}),D.map((i,s)=>i.data?.name?P.includes(i.data.name)?e.jsx(o,{size:{xs:12,md:6,lg:4},children:e.jsx(j.SocialsFields,{data:i.data,componentName:`socials[${s}]`,componentReference:"common.social",deleteCallback:()=>{w(D.filter((e,i)=>i!==s))}})},s):e.jsxs(o,{size:{xs:12,md:6,lg:4},children:[e.jsx("input",{type:"hidden",name:`socials[${s}].documentId`,value:i.data.documentId||""}),e.jsx("input",{type:"hidden",name:`socials[${s}].name`,value:i.data.name||""}),e.jsx("input",{type:"hidden",name:`socials[${s}].url`,value:i.data.url||""}),e.jsx("input",{type:"hidden",name:`socials[${s}].icon`,value:i.data.icon||""}),e.jsx(j.default,{data:{...i.data,onClick:V}})]},s):null),G.map((i,s)=>e.jsx(o,{size:{xs:12,md:6,lg:4},children:e.jsx(j.SocialsFields,{data:i.data,componentName:i.componentName,componentReference:"common.social",deleteCallback:()=>{W(G.filter((e,i)=>i!==s).map((e,i)=>({...e,componentName:`socials[${i+D.length}]`})))}})},i.data?.uuid)),e.jsx(o,{justifyContent:"center",alignItems:"center",size:{xs:12,md:6,lg:4},children:e.jsx(h,{onClick:()=>{W([...G,{componentName:`socials[${D.length+G.length}]`,componentReference:"logistics-elements.social",data:{name:"",url:""}}])},children:e.jsx(g,{})})}),e.jsx(o,{size:12,children:e.jsxs(n,{direction:"row-reverse",spacing:2,alignItems:"center",sx:{py:1},children:[e.jsx(c.SubmitButton,{text:"save changes",loadingText:"loading"}),F?.strapiErrors&&e.jsx(m.StrapiErrors,{error:F?.strapiErrors}),F?.message&&e.jsx(r,{severity:"error",children:F?.message})]})})]})})})};
|