import{jsxs as i,Fragment as p,jsx as e}from"react/jsx-runtime";import{C as d}from"./course-card-1-DFk6PmIT.js";import{b1 as u,b2 as h,b3 as f,c as b,B as s}from"./ui-components-B24mpb8o.js";import v from"embla-carousel-autoplay";import{ChevronLeft as C,ChevronRight as g}from"lucide-react";import{useState as m,useEffect as N}from"react";import"@inertiajs/react";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";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 er=({data:t})=>{const[r,n]=m(),[c,a]=m(0);return N(()=>{if(!r)return;const o=()=>{a(r.selectedScrollSnap())};return r.on("select",o),()=>{r.off("select",o)}},[r]),i(p,{children:[e(u,{setApi:n,className:"z-10 py-10",opts:{align:"start",loop:!0},plugins:[v({delay:3e3})],children:e(h,{children:t&&t.collection.map(o=>e(f,{className:"basis-full md:basis-1/2 lg:basis-1/4",children:e("div",{className:"px-1.5 py-0.5",children:e(d,{course:o},o.id)})},o.id))})}),i("div",{className:"flex items-center justify-between",children:[e("div",{className:"flex items-center justify-center gap-2.5",children:r&&t&&t.collection.map(({id:o},l)=>e("div",{className:b("cursor-pointer rounded-full transition-all duration-200",c===l?"bg-primary h-2 w-4":"h-2 w-2 bg-gray-300"),onClick:()=>r.scrollTo(l)},o))}),i("div",{className:"space-x-4",children:[e(s,{size:"icon",variant:"outline",disabled:!(r!=null&&r.canScrollPrev()),onClick:()=>r==null?void 0:r.scrollPrev(),className:"hover:border-primary hover:bg-background",children:e(C,{})}),e(s,{size:"icon",variant:"outline",disabled:!(r!=null&&r.canScrollNext()),onClick:()=>r==null?void 0:r.scrollNext(),className:"hover:border-primary hover:bg-background",children:e(g,{})})]})]})]})};export{er as default};
