2 lines
3.7 KiB
JavaScript
2 lines
3.7 KiB
JavaScript
import{r as l,b as f,j as e,L as g}from"./vendor-BKmmeuxg.js";import{I as b}from"./input-error-LaPr_4wd.js";import{B as n}from"./button-BpNwv2aE.js";import{D as v,b as j}from"./dialog-B2gN9MvT.js";import{L as t}from"./label-HmIcv5Yx.js";import{R as N,a as c}from"./radio-group-C0C2vfl-.js";import y from"./Layout-oBkGmvb1.js";import w from"./Message-DRYtxSy5.js";import C from"./StepNavigator-1X0eMKDI.js";import"./utils-DxSsnXxD.js";import"./index-WW_1X1qx.js";const L=({flash:s})=>{const[d,o]=l.useState(!1),[m,r]=l.useState(!1),{data:i,errors:u,post:p,processing:S,setData:x}=f({course_creation:"collaborative"}),h=a=>{a.preventDefault(),o(!0),r(!0),p(route("install.store-processing"),{onFinish(){o(!1),r(!1)}})};return e.jsxs("div",{children:[e.jsx(C,{step1:"fill",step2:"fill",step3:"fill",step4:"fill",step5:"active"}),d&&e.jsx("div",{id:"loader",className:"mb-4 rounded-md bg-green-100 px-5 py-3 text-center text-sm font-medium text-green-500",children:"Loading..."}),e.jsx(w,{success:s.success,error:s.error}),e.jsxs("form",{onSubmit:h,children:[e.jsxs("div",{children:[e.jsx(t,{children:"Select Course Creation Mode"}),e.jsxs(N,{required:!0,defaultValue:i.course_creation,className:"flex items-center space-x-4 pt-2 pb-1",onValueChange:a=>x("course_creation",a),children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(c,{className:"cursor-pointer",id:"collaborative",value:"collaborative"}),e.jsx(t,{htmlFor:"collaborative",children:"Collaborative"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(c,{className:"cursor-pointer",id:"administrative",value:"administrative"}),e.jsx(t,{htmlFor:"administrative",children:"Administrative"})]})]}),e.jsx(b,{message:u.course_creation}),i.course_creation==="collaborative"?e.jsx("div",{className:"mt-3 rounded-md border border-orange-200 bg-orange-50 p-4",children:e.jsxs("p",{className:"text-sm leading-relaxed text-gray-700",children:[e.jsx("span",{className:"mb-1 block font-medium text-orange-600",children:"Collaborative Mode:"}),"Enable a collaborative platform where qualified users can become instructors and create their own courses. The platform administrator will receive a percentage of revenue from each instructor's course sales."]})}):e.jsx("div",{className:"mt-3 rounded-md border border-orange-200 bg-orange-50 p-4",children:e.jsxs("p",{className:"text-sm leading-relaxed text-gray-700",children:[e.jsx("span",{className:"mb-1 block font-medium text-orange-600",children:"Administrative Mode:"}),"Centralize course management where only administrators can create and publish educational content. Students can enroll in these official courses, with all revenue flowing directly to the platform administration."]})})]}),e.jsxs("div",{className:"mt-12 flex w-full items-center justify-end gap-4",children:[e.jsx(g,{href:route("install.show-step4"),children:e.jsx(n,{type:"button",variant:"outline",className:"border border-orange-500 !bg-transparent !text-orange-500 uppercase",children:"Previous Step"})}),e.jsx(n,{type:"submit",className:"bg-orange-500 px-6 py-3 text-white uppercase hover:bg-orange-600/90",children:"Confirm"})]})]}),e.jsx(v,{open:m,onOpenChange:r,children:e.jsx(j,{children:e.jsxs("div",{className:"modal-box ! !rounded-md !bg-orange-50 !p-4 md:max-w-md",children:[e.jsx("p",{className:"!mb-6 !text-justify !font-medium",children:"Your app is currently undergoing an automatic installation. This process will take a few minutes. Please don't refresh your page or turn off your device. Just stay with this process."}),e.jsx("div",{className:"relative mt-6 w-full rounded-full bg-gray-200",children:e.jsx("div",{id:"shim-blue",className:"absolute h-2 animate-pulse rounded-full bg-blue-500",style:{width:"100%"}})})]})})})]})};L.layout=s=>e.jsx(y,{children:s});export{L as default};
|