const h="N.D.",a={PrimoStep:{button1:{name:"Annulla",classname:"btn btn-link"},button2:{name:"Salva Bozza",classname:"btn btn-primary"},button3:{name:"Continua",classname:"btn btn-primary"}},AltriStep:{button1:{name:"Indietro",classname:"btn btn-primary pull-left"},button2:{name:"Annulla",classname:"btn btn-link"},button3:{name:"Salva Bozza",classname:"btn btn-primary"},button4:{name:"Continua",classname:"btn btn-primary"}},StepSalvataggio:{button1:{name:"Indietro",classname:"btn btn-primary pull-left"},button2:{name:"Annulla",classname:"btn btn-link"},button3:{name:"Salva Bozza",classname:"btn btn-primary disabled"},button4:{name:"Continua",classname:"btn btn-primary"}},UltimoStep:{button1:{name:"Indietro",classname:"btn btn-primary pull-left"},button2:{name:"Annulla",classname:"btn btn-link"},button3:{name:"Termina",classname:"btn btn-primary btn-success"},button4:{name:"Salva Bozza",classname:"btn btn-primary"}}},B=({gruppoAzioni:s})=>{const m=[];let n=s.replace(/\s/g,"");for(let t=1;t<=Object.keys(a[n]).length;t++){const e=document.createElement("button"),l=`button${t}`;e.textContent=`${a[n][l].name}`;let y=a[n][l].classname.includes("link");e.type=y?"reset":"submit",e.className=`${a[n][l].classname}`,m.push(e);let f=a[n][l].classname.includes("disabled");if(e.disabled=f,t==1&&s!=="Primo Step"){var c=document.createElement("i");c.className="fa left fa-angle-left",e.insertBefore(c,e.firstChild)}if(t==Object.keys(a[n]).length&&s!=="Ultimo Step"){var u=document.createElement("i");u.className="fa fa-angle-right right",e.appendChild(u)}}const g=m.slice(0,Object.keys(a[n]).length-2),S=m.slice(Object.keys(a[n]).length-2),i=document.createElement("div");g.forEach(t=>{i.appendChild(t)});const o=document.createElement("div");if(o.className="pull-right",s==="Step Salvataggio"){const t=document.createElement("span");t.className="feedbackInline";const e=document.createElement("strong");e.textContent="Bozza salvata alle 10.40",t.appendChild(e),o.appendChild(t)}return S.forEach(t=>{o.appendChild(t)}),i.appendChild(o),i},C={title:"Components/Tasti e link/Button Group",tags:["autodocs"],render:s=>B(s),argTypes:{gruppoAzioni:{control:{type:"select"},options:["Primo Step","Altri Step","Step Salvataggio","Ultimo Step"],description:"Actions group.",table:{defaultValue:{summary:"Primo Step"}}}},parameters:{docs:{mdxPage:h}}},r={args:{gruppoAzioni:"Primo Step"}};var p,b,d;r.parameters={...r.parameters,docs:{...(p=r.parameters)==null?void 0:p.docs,source:{originalSource:`{
  args: {
    gruppoAzioni: "Primo Step"
  }
}`,...(d=(b=r.parameters)==null?void 0:b.docs)==null?void 0:d.source}}};const k=["ButtonGroup"];export{r as ButtonGroup,k as __namedExportsOrder,C as default};
