1import{b8 as b,aY as a,at as t}from"./.pnpm-DsWhPSJO.js";import{C as x}from"./ComponentDataTable-DqO00vgu.js";import{b as p}from"./DashboardLayout-D6O3WOCK.js";import"./MenuToggle-B7LuEM26.js";import"./assetPath-bsj2iDPi.js";const u=async i=>{const s=await fetch(i);if(!s.ok)throw new Error("Failed to load internship exhibitors.");return s.json()};function y({apiUrl:i}){const{data:s,error:o}=b(i,u,{revalidateOnFocus:!1}),l=!s&&!o,d=s?.exhibitors??[],n=window.location.pathname,c=[{name:"ID",selector:e=>e.id,sortable:!0},{name:"Company Name",selector:e=>e.name,sortable:!0},{name:"Hall",selector:e=>e.exhibitor_hall?e.exhibitor_hall.name+"-"+e.exhibitor_hall.year:"-",sortable:!0},{name:"Booth No",selector:e=>e.booth_no,sortable:!0},{name:"Year",selector:e=>e.year,sortable:!0},{name:"Products",selector:e=>e.exhibitor_product?.length??0,sortable:!0},{name:"Status",selector:e=>e.status===1?"Active":"Nonactive",sortable:!0},{name:"Action",selector:e=>e.id,cell:e=>a.jsxs("div",{className:"flex my-2 gap-2",children:[a.jsx(t,{href:n+"/"+e.id+"/edit",className:"btn btn-primary",children:"Edit"}),a.jsx(t,{as:"button",method:"delete",className:"btn btn-warning",href:n+"/"+e.id,children:e.status===1?"Deactive":"Activate"})]})}],h=({data:e})=>a.jsxs("div",{className:"grid grid-cols-12 gap-1 my-2",children:[a.jsx("div",{className:"col-span-12",children:a.jsx(t,{href:"/dashboard/internship/add-product/"+e.id,className:"btn btn-primary btn-sm",children:"Add Product"})}),(e.exhibitor_product??[]).map((r,m)=>a.jsxs("div",{className:"col-span-12 grid grid-cols-12 gap-1 my-1",children:[a.jsxs("div",{className:"col-span-4",children:["Product Name = ",r.name]}),a.jsxs("div",{className:"col-span-4",children:["Photo = ",r.image?"Available":"Not Available"]}),a.jsxs("div",{className:"col-span-4 flex gap-2",children:[a.jsx(t,{href:"/dashboard/internship/product/"+r.id+"/edit",className:"btn btn-warning btn-sm",children:"Edit"}),a.jsx(t,{as:"button",method:"delete",href:"/dashboard/internship/product/"+r.id,className:"btn btn-info btn-sm",children:"Delete"})]})]},m))]});return a.jsx(p,{active:"",header:"List Exhibitor",subTitle:"List of Exhibitor",children:a.jsxs("div",{className:"grid grid-cols-12 gap-1",children:[a.jsx("div",{className:"col-span-12 md:col-span-4",children:a.jsx(t,{href:"/dashboard/internship/exhibitor/create",className:"btn btn-primary mx-2",children:"Add New Exhibitor"})}),a.jsxs("div",{className:"col-span-12 overflow-x-auto",children:[o?a.jsx("div",{className:"alert alert-error",children:"Failed to load exhibitor data."}):null,l?a.jsx("p",{className:"text-matte-brown",children:"Loading exhibitors..."}):a.jsx(x,{columns:c,data:d,expandableRows:!0,expandableRowsComponent:h})]})]})})}export{y as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.