2 lines
3.2 KiB
JavaScript
2 lines
3.2 KiB
JavaScript
import{u as j,j as s,A as m,L as f,k as g,bW as N,cT as w,C as _,e as i}from"./vendor-BKmmeuxg.js";import{B as l}from"./button-BpNwv2aE.js";import{C as y,b}from"./card-D9_SJYq6.js";import{S as v}from"./separator-_3LZ_wAA.js";import{s as C}from"./utils-DxSsnXxD.js";import"./index-WW_1X1qx.js";const E=()=>{const{auth:o,exam:e,system:d,wishlist:r,enrollment:c,translate:x}=j().props,{frontend:t}=x,a=C(d.fields.selling_currency),p=()=>{r?i.delete(route("exam-wishlists.destroy",e.id)):i.post(route("exam-wishlists.store",e.id))},h=u=>{var n;i.post(route("exam-enrollments.store"),{user_id:(n=o.user)==null?void 0:n.id,exam_id:u.id,enrollment_type:"free"})};return s.jsx(y,{className:"sticky top-24",children:s.jsxs(b,{className:"p-6",children:[s.jsx("img",{className:"mb-4 w-full rounded-lg",src:e.thumbnail??"/assets/images/blank-image.jpg",alt:""}),c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"rounded-lg bg-green-50 p-4 text-center",children:[s.jsx(m,{className:"mx-auto mb-2 h-8 w-8 text-green-600"}),s.jsx("p",{className:"font-semibold text-green-900",children:"You're enrolled!"})]}),s.jsx(l,{asChild:!0,className:"w-full",children:s.jsx(f,{href:route("student.exam.show",{id:e.id,tab:"attempts"}),children:"View Exam"})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("h2",{className:"text-4xl font-bold capitalize",children:e.pricing_type==="free"?e.pricing_type:e.discount?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"font-semibold",children:[a==null?void 0:a.symbol,e.discount_price]}),s.jsxs("span",{className:"text-muted-foreground ml-2 text-base font-medium line-through",children:[a==null?void 0:a.symbol,e.price]})]}):s.jsx(s.Fragment,{children:s.jsxs("span",{className:"font-semibold",children:[a==null?void 0:a.symbol,e.price]})})}),s.jsx(l,{className:"w-full px-1 sm:px-3",variant:"outline",size:"lg",onClick:p,children:r?t.remove_from_wishlist:t.add_to_wishlist}),e.pricing_type==="free"?s.jsx(l,{size:"lg",className:"w-full",onClick:()=>h(e),children:t.enroll_now}):s.jsx("a",{href:route("payments.index",{from:"web",item:"exam",id:e.id}),children:s.jsx(l,{size:"lg",className:"w-full",children:t.buy_now})})]}),s.jsx(v,{className:"my-6"}),s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(g,{className:"h-4 w-4 text-gray-400"}),s.jsxs("span",{children:[e.duration_hours>0&&`${e.duration_hours} hours `,e.duration_minutes>0&&`${e.duration_minutes} minutes`]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(N,{className:"h-4 w-4 text-gray-400"}),s.jsxs("span",{children:[e.total_questions," questions"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(m,{className:"h-4 w-4 text-gray-400"}),s.jsxs("span",{children:[e.max_attempts," attempts allowed"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(w,{className:"h-4 w-4 text-gray-400"}),s.jsxs("span",{children:[e.pass_mark," marks to pass"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_,{className:"h-4 w-4 text-gray-400"}),s.jsx("span",{className:"capitalize",children:e.expiry_type==="lifetime"?"Lifetime":e.expiry_duration})]})]})]})})};export{E as default};
|