PageSourceSearch

https://www.gafferdistrict.com/assets/MerchantVendorRegistrationsView-DVLOgHF1.js

js gafferdistrict.com collected 2026-10-02 07:55:50 UTC 6,596 bytes, 1 lines download raw bytes

1import{r as i,j as e}from"./vendor-react-BKK2cemD.js";import{M as N,a as k}from"./MerchantContextBanner-BaSQMf0n.js";import{s as l}from"./index-dYSgqNAK.js";import{a as v,b as w}from"./vendor-router-MWzdZqT4.js";import"./vendor-posthog-DaPeprxb.js";import"./vendor-lucide-Cg1iQ9zl.js";import"./vendor-maplibre-CpI4tf7S.js";const T=()=>{const d=v(),[m]=w(),[o,c]=i.useState([]),[p,x]=i.useState(!0),[n,u]=i.useState(null),[S,h]=i.useState(""),b=async()=>{try{const t=await fetch("/api/cms/session",{credentials:"include"});if(t.ok){const s=await t.json();s.authenticated?(u(s.user),s.user.role!=="admin"&&s.user.businessId!==100&&d("/merchant/dashboard")):d("/merchant/login")}else d("/merchant/login")}catch(t){console.error("Failed to load session:",t),d("/merchant/login")}},g=async()=>{x(!0);try{const t=await fetch("/api/data/vendor-registrations.json");if(t.ok){const s=await t.json();s.sort((a,r)=>new Date(r.submittedAt).getTime()-new Date(a.submittedAt).getTime()),c(s)}}catch(t){console.error("Failed to load registrations:",t)}finally{x(!1)}},f=async(t,s)=>{const a=o.map(r=>r.id===t?{...r,status:s}:r);try{(await fetch("/api/data/vendor-registrations.json",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a),credentials:"include"})).ok?c(a):alert("Failed to update status")}catch(r){console.error("Error updating status:",r)}},j=async t=>{if(!confirm("Are you sure you want to delete this registration?"))return;const s=o.filter(a=>a.id!==t);try{(await fetch("/api/data/vendor-registrations.json",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),credentials:"include"})).ok&&c(s)}catch(a){console.error("Error deleting registration:",a)}};i.useEffect(()=>{b(),g();const t=m.get("businessId")||localStorage.getItem("selectedBusinessId")||"";h(t)},[]);const y=t=>{switch(t){case"New":return"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300";
1case"Responded":return"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300";case"Accepted":return"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300";default:return"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-300"}};return e.jsxs("div",{className:"flex h-screen overflow-hidden bg-background-light dark:bg-background-dark",children:[e.jsx(N,{currentUser:n,selectedBusiness:null,handleBusinessSelect:()=>{},showBusinessSelector:!1,setShowBusinessSelector:()=>{}}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(k,{business:null,isAdmin:(n==null?void 0:n.role)==="admin"||(n==null?void 0:n.businessId)===100}),e.jsx("header",{className:"sticky top-0 z-10 border-b border-gray-200 dark:border-white/10 bg-white/80 dark:bg-black/60 backdrop-blur-md",children:e.jsx("div",{className:"max-w-7xl mx-auto w-full px-8 py-6 flex items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-semibold mb-1 border-l-4 border-primary pl-4 text-black dark:text-white",children:"Vendor & Artist Registrations"}),e.jsx("p",{className:"text-sm text-[#8a7960] pl-4",children:"Review and manage community event applications"})]})})}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx("div",{className:"max-w-7xl mx-auto px-8 py-8",children:e.jsx("div",{className:"bg-white dark:bg-[#1a140d] rounded-none shadow-sm border border-gray-200 dark:border-white/10 overflow-hidden",children:p?e.jsx("div",{className:"p-12 text-center text-muted",children:"Loading registrations..."}):o.length===0?e.jsx("div",{className:"p-12 text-center text-muted",children:"No registrations found."}):e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-gray-50 dark:bg-black/20 border-b border-gray-200 dark:border-white/10",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-4 text-left text-xs font-semibold uppercase text-zinc-600 dark:text-muted",children:"Applicant"}),e.jsx("th",{className:"px-6 py-4 text-left text-xs font-semibold uppercase text-zinc-600 dark:text-muted",children:"Categories & Portfolio"}),e.jsx("th",{className:"px-6 py-4 text-left text-xs font-semibold uppercase text-zinc-600 dark:text-muted",children:"Target Events"}),e.jsx("th",{className:"px-6 py-4 text-left text-xs font-semibold uppercase text-zinc-600 dark:text-muted",children:"Status"}),e.jsx("th",{className:"px-6 py-4 text-right text-xs font-semibold uppercase text-zinc-600 dark:text-muted",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-white/10",children:o.map(t=>e.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-white/5 transition-colors",children:[e.jsxs("td",{className:"px-6 py-4",children:[e.jsx("div",{className:"font-semibold",children:l(t.fullName)}),e.jsx("div",{className:"text-xs text-[#8a7960]",children:l(t.businessName)}),e.jsxs("div",{className:"text-xs text-muted mt-1",children:["Submitted: ",new Date(t.submittedAt).toLocaleDateString()]})]}),e.jsxs("td",{className:"px-6 py-4",children:[e.jsx("span",{className:"px-2 py-0.5 rounded-none bg-zinc-100 dark:bg-zinc-800 text-[10px] uppercase font-semibold text-zinc-600 dark:text-muted",children:l(t.category)}),e.jsx("div",{className:"mt-2",children:e.jsxs("a",{href:t.portfolioLink,target:"_blank",rel:"noreferrer",className:"text-xs text-primary hover:underline flex items-center gap-1",children:[e.jsx("span",{className:"material-symbols-outlined text-xs",children:"link"})," Portfolio"]})}),e.jsxs("div",{className:"text-xs text-muted mt-1 line-clamp-2 italic",children:['"',l(t.bio),'"']})]}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("div",{className:"flex flex-wrap gap-1",children:t.selectedEvents.map(s=>e.jsx("span",{className:"px-2 py-0.5 rounded-none bg-amber-50 dark:bg-amber-900/20 text-[10px] text-amber-700 dark:text-amber-400 border border-amber-100 dark:border-amber-800",children:s},s))})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("select",{value:t.status,onChange:s=>f(t.id,s.target.value),className:`text-xs font-semibold uppercase px-2 py-1 rounded-none outline-none cursor-pointer ${y(t.status)}`,children:[e.jsx("option",{value:"New",children:"New"}),e.jsx("option",{value:"Responded",children:"Responded"}),e.jsx("option",{value:"Accepted",children:"Accepted"})]})}),e.jsx("td",{className:"px-6 py-4 text-right",children:e.jsx("button",{onClick:()=>j(t.id),className:"p-2 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-none",children:e.jsx("span",{className:"material-symbols-outlined text-sm",children:"delete"})})})]},t.id))})]})})})})]})]})};export{T 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.