%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/opti/www/startup-life/assets/
Upload File :
Create Path :
Current File : /home/opti/www/startup-life/assets/set-add-budget-cc045c98.js

import{r as g,b as A,Q as H,j as e}from"./index-5492fbe1.js";import{C as b}from"./index-2c4b8b3c.js";import{s as p}from"./style.module-d249dcf0.js";import{B as t}from"./Box-263f925f.js";import{C as N}from"./Checkbox-5f253e47.js";import{I}from"./index-fbb310b5.js";import{C as T}from"./index-fdf728e2.js";import{G as j}from"./Grid-edacc4c9.js";const n=[{title:"All",value:"ALL"},{title:"Under 18 years",value:"UNDER_EIGHTEEN"},{title:"18-24 years",value:"EIGHTEEN_TO_TWENTY_FOUR"},{title:"25-35 years",value:"TWENTY_FIVE_TO_THIRTY_FIVE"},{title:"36 years and above",value:"THIRTY_SIX_AND_ABOVE"}],o=["All","Founders/Business owners","Vendors","Creatives","Investors"],y=({selectedLocation:i,handleSelectedLocation:x,selectedDemo:d,handleSelectedDemo:h,selectedAcc:m,handleSelectedAcc:u})=>{const[f,E]=g.useState(""),[r,C]=g.useState([{label:"",value:""}]),[c,_]=g.useState(""),w=s=>{if(i.includes(s)){console.log("same"),x([...i.filter(a=>a!==s)]);return}x([...i,s])};g.useEffect(()=>{A.get("https://restcountries.com/v2/all").then(s=>{console.log(s.data),C(s.data)}).catch(s=>{H.error("Error fetching country data due to poor netwrok. Kindly wait for one minute before refresh then try again or click to continue for default locations to be set for this ad",s)})},[]);const v=r==null?void 0:r.filter(s=>{var a;return(a=s==null?void 0:s.name)==null?void 0:a.toLowerCase().includes(c==null?void 0:c.toLowerCase())});return e.jsxs("div",{style:{width:"500px",marginBottom:"140px"},children:[e.jsx("div",{className:p.title,children:e.jsx("h3",{children:"Set Ad Target"})}),e.jsx("div",{className:p.target,onClick:()=>E("locations"),children:e.jsx("h2",{children:"Locations"})}),e.jsx(b,{appear:f==="locations",children:e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"search",value:c,onChange:s=>_(s.target.value),className:"SearchInput w-full outline-none p-[10px]",placeholder:"Search Country"}),(r==null?void 0:r.length)>0&&e.jsxs(t,{sx:{maxHeight:"300px",background:"rgba(168, 207, 69, 0.14)",overflow:"scroll",width:"100%",padding:"20px 0 20px 20px",marginBottom:"20px"},children:[e.jsx("p",{className:"countriesLabel",children:"Select country"}),e.jsx("ul",{className:"countryListing",children:v==null?void 0:v.map((s,a)=>{var l;return e.jsxs("li",{className:"flex justify-between",children:[e.jsxs(t,{sx:{display:"flex",gap:".37rem"},children:[e.jsx("div",{className:"h-[40px] w-[40px]",children:e.jsx("img",{src:(l=s==null?void 0:s.flags)==null?void 0:l.png,height:"100%",width:"100%",alt:"flag"})}),e.jsxs("p",{children:[s==null?void 0:s.name," "]})]}),e.jsx(N,{sx:{color:"#A8CF45","&.Mui-checked":{color:"#A8CF45"}},checked:i.includes(s==null?void 0:s.name),onChange:()=>w(s==null?void 0:s.name)})]},a)})})]})]})}),e.jsx("div",{className:p.target,onClick:()=>E("demographic"),children:e.jsx("h2",{children:"Demographic"})}),e.jsx(b,{appear:f==="demographic",children:e.jsx(t,{sx:{maxHeight:"300px",background:"rgba(168, 207, 69, 0.14)",overflow:"scroll",width:"100%",marginBottom:"20px"},children:e.jsx("ul",{className:"countryListing",children:n==null?void 0:n.map((s,a)=>e.jsxs("li",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingLeft:"20px"},children:[e.jsx(t,{sx:{display:"flex",gap:".37rem"},children:e.jsxs("p",{children:[s.title," "]})}),e.jsx(N,{sx:{color:"#A8CF45","&.Mui-checked":{color:"#A8CF45"}},checked:d.includes(s.value),onChange:()=>{if(s.title==="All"){if(d.length===n.length){h([]);return}h([...n.map(l=>l.value)]),console.log([...n.map(l=>l.value)]);return}if(d.includes(s.value)){h([...d.filter(l=>l!==s.value&&l!=="ALL")]);return}h([...d,s.value])}})]},a))})})}),e.jsx("div",{className:p.target,onClick:()=>E("accounts"),children:e.jsx("h2",{children:"Accounts"})}),e.jsx(b,{appear:f==="accounts",children:e.jsx(t,{sx:{maxHeight:"300px",background:"rgba(168, 207, 69, 0.14)",overflow:"scroll",width:"100%",marginBottom:"20px"},children:e.jsx("ul",{className:"countryListing",children:o==null?void 0:o.map((s,a)=>e.jsxs("li",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingLeft:"20px"},children:[e.jsx(t,{sx:{display:"flex",gap:".37rem"},children:e.jsxs("p",{children:[s," "]})}),e.jsx(N,{sx:{color:"#A8CF45","&.Mui-checked":{color:"#A8CF45"}},checked:m.includes(s),onChange:()=>{if(s==="All"){if(m.length===o.length){u([]);return}u([...o.map(l=>l)]),console.log([...o.map(l=>l)]);return}if(m.includes(s)){u([...m.filter(l=>l!==s&&l!=="All")]);return}u([...m,s])}})]},a))})})})]})},L=({control:i,handleChange:x})=>e.jsxs("div",{className:"mb-[40px]",children:[e.jsx("div",{className:p.title,children:"Custom Ads"}),e.jsxs("div",{className:"text-gray-500 text-[1rem] mb-[20px]",children:["Invest up to 5000 and more to get your advert to show ",e.jsx("strong",{children:"In-app"})," and ",e.jsx("strong",{children:"In-Mail"})]}),e.jsxs(j,{container:!0,md:12,spacing:4,children:[e.jsx(j,{item:!0,md:6,sx:{mb:"1.5rem"},children:e.jsx(I,{name:"budget",type:"number",label:"Budget (minimum of N3000)",control:i,rules:{required:"Budget"}})}),e.jsx(j,{item:!0,md:6,sx:{mb:"1.5rem"},children:e.jsx(T,{handleChange:x,options:[{label:"Card Payment",value:"Card Payment"}],name:"billing",control:i,rules:{required:"Select your company status"},label:"Billing"})}),e.jsx(j,{item:!0,md:6,sx:{mb:"1.5rem"},children:e.jsx(T,{handleChange:x,options:[{label:"ONE_WEEK",value:"ONE_WEEK"},{label:"TWO_WEEK",value:"TWO_WEEK"},{label:"THREE_WEEK",value:"THREE_WEEK"},{label:"A MONTH",value:"MONTH"},{label:"TWO_MONTH",value:"TWO_MONTH"},{label:"THREE_MONTH",value:"THREE_MONTH"},{label:"QUARTER",value:"QUARTER"},{label:"YEAR",value:"YEAR"}],name:"duration",control:i,rules:{required:"Set add duration"},label:"Set Ads duration"})})]})]});export{y as S,L as a};

Zerion Mini Shell 1.0