import{jsx as r}from"react/jsx-runtime";import{C as c}from"./checkout-item-C6mQbTml.js";import{B as m}from"./ui-components-B24mpb8o.js";import{usePage as u,router as a}from"@inertiajs/react";import"next-themes";import"sonner";import"react";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"lucide-react";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";const T=({auth:p,course:t})=>{const{props:e}=u(),{translate:n}=e,{frontend:o}=n,l=s=>{var i;a.post(route("enrollments.store"),{user_id:(i=p.user)==null?void 0:i.id,course_id:s.id,enrollment_type:"free"})};return t.pricing_type==="free"?r(m,{size:"lg",className:"w-full",onClick:()=>l(t),children:o.enroll_now}):r(c,{item:"course",item_id:t.id,children:r(m,{size:"lg",className:"w-full",children:o.buy_now})})};export{T as default};
