PageSourceSearch

https://octofold.com/build/assets/Index-BE2epsYN.js

js octofold.com collected 2026-10-03 20:09:07 UTC 11,289 bytes, 1 lines download raw bytes

1import{r as x,j as e}from"./vendor-react-BzXAup97.js";import{H as W,r as v,L as z}from"./vendor-inertia-C6ujBw2R.js";import{A as G}from"./AdminPageWrapper-Uq3LcqGL.js";import{C as f,a as y}from"./Card-Czp7NDRY.js";import{u as A,B as h}from"./app-BcVXXONv.js";import{B as i}from"./Badge-BYM-_53-.js";import{I as Q}from"./Input-Cg7VKGAS.js";import{S as V}from"./Select-By7TTUYq.js";import{T as X,a as J,b as S,c as d,d as K,e as r}from"./Table-Cn6JNXmi.js";import{D as U,i as Y,j as Z,k as w,A as D,b as T,c as H,d as M,e as k,f as B,g as F,h as E}from"./AuthenticatedLayout-CluqGnv5.js";import{p as $,bE as ee,P as se,ad as ae,d as te,ab as ne,T as le,aa as ie}from"./vendor-lucide-1jXEw7Bh.js";import{f as b}from"./format-BUR2h4xf.js";import{p as g}from"./parseISO-1g-afBcY.js";import"./vendor-radix-Bha8dDJB.js";import"./vendor-tiptap-CF47o3zI.js";import"./vendor-recharts-MX9_f30n.js";import"./vendor-assistant-ui-rpsJ9Qdc.js";import"./vendor-voip-BKCre8sD.js";import"./pushNotifications-BVHqr3g7.js";import"./vendor-firebase-CCnLmBjb.js";import"./UpgradeModal-H1XLTufz.js";import"./upgradeFeatureCatalog-DQsdO-8d.js";import"./AppModal-Bf_aZlPN.js";import"./transition-Cx0OHrt1.js";import"./dialog-D_ql7LVY.js";import"./Sheet-BZ90mOOl.js";import"./rememberedProfile-pkm-wW4S.js";import"./vendor-framer-DOQvBjnK.js";import"./vendor-dnd-aV9yv6Pg.js";import"./useRoutePulse-Cu98qn9H.js";import"./vendor-ably-DQ6H01js.js";import"./en-US-DG4gdrMG.js";function qe({placements:a,filters:n,counts:l}){const{t}=A(),[c,o]=x.useState(n.status),[p,_]=x.useState(n.scope),[N,L]=x.useState(n.q??""),C=s=>{v.get(route("admin.business.featured-placements.index"),{status:s.status??c,scope:s.scope??p,q:s.q??N},{preserveState:!0,replace:!0})},m=s=>{o(s),C({status:s})},R=s=>{s.preventDefault(),C({q:N})};return e.jsxs(G,{title:t("mybusiness.admin.featured_placements.index_title","Featured placements"),header:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h1",{className:"text-xl font-semibold leading-tight text-foreground",children:t("mybusiness.admin.featured_placements.index_title","Featured placements")}),e.jsx(h,{size:"sm",asChild:!0,className:"ml-auto",children:e.jsxs(z,{href:route("admin.business.featured-placements.create"),children:[e.jsx(se,{className:"mr-1 h-4 w-4"}),t("mybusiness.admin.featured_placements.add_placement","Add placement")]})})]}),children:[e.jsx(W,{title:t("mybusiness.admin.featured_placements.index_title","Featured placements")}),e.jsxs("div",{className:"space-y-4 p-4 md:p-6",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(u,{active:c==="active",onClick:()=>m("active"),label:t("mybusiness.admin.featured_placements.tab_active","Active"),count:l.active}),e.jsx(u,{active:c==="scheduled",onClick:()=>m("scheduled"),label:t("mybusiness.admin.featured_placements.tab_scheduled","Scheduled"),count:l.scheduled}),e.jsx(u,{active:c==="expired",onClick:()=>m("expired"),label:t("mybusiness.admin.featured_placements.tab_expired","Expired"),count:l.expired}),e.jsx(u,{active:c==="cancelled",onClick:()=>m("cancelled"),label:t("mybusiness.admin.featured_placements.tab_cancelled","Cancelled"),count:l.cancelled}),e.jsx(u,{active:c==="all",onClick:()=>m("all"),label:"All",count:l.all})]}),e.jsx(f,{children:e.jsxs(y,{className:"grid grid-cols-1 gap-3 p-4 sm:grid-cols-[1fr_220px_auto]",children:[e.jsxs("form",{onSubmit:R,className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx($,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(Q,{value:N,onChange:s=>L(s.target.value),placeholder:"business name or slug",className:"pl-9"})]}),e.jsx(h,{type:"submit",variant:"outline",children:"Search"})]}),e.jsxs(V,{value:p,onChange:s=>{const j=s.target.value;_(j),C({scope:j})},children:[e.jsx("option",{value:"all",children:"All scopes"}),e.jsx("option",{value:"global",children:t("mybusiness.admin.featured_placements.scope.global","Global")}),e.jsx("option",{value:"city",children:t("mybusiness.admin.featured_placements.scope.city","City")}),e.jsx("option",{value:"category",children:t("mybusiness.admin.featured_placements.scope.category","Category")}),e.jsx("option",{value:"city_category",children:t("mybusiness.admin.featured_placements.scope.city_category","City + Category")})]})]})}),e.jsx(f,{className:"hidden md:block",children:e.jsx(y,{className:"p-0",children:e.jsxs(X,{children:[e.jsx(J,{children:e.jsxs(S,{children:[e.jsx(d,{children:t("mybusiness.admin.featured_placements.business_label","Business")}),e.jsx(d,{className:"w-[140px]",children:t("mybusiness.admin.featured_placements.scope_label","Scope")}),e.jsx(d,{className:"w-[180px]",children:"Where"}),e.jsx(d,{className:"w-[180px]",children:"Window"}),e.jsx(d,{className:"w-[90px]",children:"Prio"}),e.jsx(d,{className:"w-[120px]",children:"Status"}),e.jsx(d,{className:"w-[140px]",children:"Payment ref"}),e.jsx(d,{className:"w-[80px] text-right",children:"Actions"})]})}),e.jsxs(K,{children:[a.data.map(s=>e.jsxs(S,{children:[e.jsxs(r,{children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-medium text-foreground",children:[s.business?.name??"—",s.business?.verified&&e.jsx(ee,{className:"h-3.5 w-3.5 text-emerald-500"})]}),s.business?.slug&&e.jsx("div",{className:"text-xs text-muted-foreground",children:s.business.slug})]}),e.jsx(r,{children:e.jsx(I,{scope:s.scope})}),e.jsxs(r,{className:"text-xs",children:[s.city?.name&&e.jsx(i,{variant:"outline",className:"mr-1",children:s.city.name}),s.category?.name&&e.jsx(i,{variant:"outline",children:s.category.name}),!s.city?.name&&!s.category?.name&&"—"]}),e.jsxs(r,{className:"text-xs text-muted-foreground",children:[e.jsx("div",{children:s.starts_at?b(g(s.starts_at),"yyyy-MM-dd HH:mm"):"—"}),e.jsx("div",{children:s.ends_at?b(g(s.ends_at),"yyyy-MM-dd HH:mm"):"—"})]}),e.jsx(r,{className:"font-mono text-xs",children:s.priority}),e.jsx(r,{children:e.jsx(O,{status:s.status})}),e.jsx(r,{className:"text-xs text-muted-foreground",children:s.payment_reference??"—"}),e.jsx(r,{className:"text-right",children:e.jsx(P,{placement:s})})]},s.id)),a.data.length===0&&e.jsx(S,{children:e.jsx(r,{colSpan:8,className:"py-16 text-center",children:e.jsx(q,{})})})]})]})})}),e.jsxs("div",{className:"space-y-3 md:hidden",children:[a.data.map(s=>e.jsx(f,{children:e.jsxs(y,{className:"space-y-3 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(I,{scope:s.scope}),e.jsx(O,{status:s.status}),e.jsxs("span",{className:"ml-auto font-mono text-[11px] text-muted-foreground",children:["prio ",s.priority]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-foreground",children:s.business?.name??"—"}),s.business?.slug&&e.jsx("div",{className:"text-xs text-muted-foreground",children:s.business.slug})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.city?.name&&e.jsx(i,{variant:"outline",className:"mr-1",children:s.city.name}),s.category?.name&&e.jsx(i,{variant:"outline",children:s.category.name})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsx("div",{children:s.starts_at?b(g(s.starts_at),"yyyy-MM-dd HH:mm"):"—"}),e.jsx("div",{children:s.ends_at?b(g(s.ends_at),"yyyy-MM-dd HH:mm"):"—"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(P,{placement:s})})]})},s.id)),a.data.length===0&&e.jsx(f,{children:e.jsx(y,{className:"py-12 text-center",children:e.jsx(q,{})})})]}),a.last_page>1&&e.jsx("div",{className:"flex flex-wrap items-center justify-center gap-1 pt-2",children:a.links.map((s,j)=>e.jsx(h,{variant:s.active?"default":"outline",size:"sm",disabled:!s.url,onClick:()=>s.url&&v.visit(s.url,{preserveScroll:!0}),className:"min-w-[36px]",children:e.jsx("span",{dangerouslySetInnerHTML:{__html:s.label}})},j))})]})]})}function u({active:a,onClick:n,label:l,count:t}){return e.jsxs(h,{variant:a?"default":"outline",size:"sm",onClick:n,children:[e.jsx("span",{children:l}
1),e.jsx(i,{variant:"secondary",className:"ml-2 bg-foreground/10 text-foreground",children:t})]})}function I({scope:a}){const{t:n}=A(),l={global:n("mybusiness.admin.featured_placements.scope.global","Global"),city:n("mybusiness.admin.featured_placements.scope.city","City"),category:n("mybusiness.admin.featured_placements.scope.category","Category"),city_category:n("mybusiness.admin.featured_placements.scope.city_category","City + Category")};return e.jsx(i,{variant:"outline",children:l[a]})}function O({status:a}){return a==="active"?e.jsx(i,{className:"border-emerald-500/20 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:"Active"}):a==="scheduled"?e.jsx(i,{className:"border-blue-500/20 bg-blue-500/10 text-blue-600 dark:text-blue-400",children:"Scheduled"}):a==="cancelled"?e.jsx(i,{variant:"destructive",children:"Cancelled"}):e.jsx(i,{variant:"outline",className:"text-muted-foreground",children:"Expired"})}function P({placement:a}){const{t:n}=A(),[l,t]=x.useState(!1),[c,o]=x.useState(!1),p=()=>{v.post(route("admin.business.featured-placements.cancel",a.id),{},{preserveScroll:!0,onFinish:()=>t(!1)})},_=()=>{v.delete(route("admin.business.featured-placements.destroy",a.id),{preserveScroll:!0,onFinish:()=>o(!1)})};return e.jsxs(e.Fragment,{children:[e.jsxs(U,{children:[e.jsx(Y,{asChild:!0,children:e.jsx(h,{variant:"ghost",size:"sm",children:e.jsx(ae,{className:"h-4 w-4"})})}),e.jsxs(Z,{align:"end",children:[e.jsx(w,{asChild:!0,children:e.jsxs(z,{href:route("admin.business.featured-placements.edit",a.id),children:[e.jsx(te,{className:"mr-2 h-4 w-4"}),"Edit"]})}),a.status!=="cancelled"&&a.status!=="expired"&&e.jsxs(w,{onSelect:()=>t(!0),children:[e.jsx(ne,{className:"mr-2 h-4 w-4"}),n("mybusiness.admin.featured_placements.cancel_action","Cancel placement")]}),e.jsxs(w,{onSelect:()=>o(!0),children:[e.jsx(le,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),e.jsx(D,{open:l,onOpenChange:t,children:e.jsxs(T,{children:[e.jsxs(H,{
1children:[e.jsx(M,{children:n("mybusiness.admin.featured_placements.cancel_confirm_title","Cancel this placement?")}),e.jsx(k,{children:n("mybusiness.admin.featured_placements.cancel_confirm_body","The placement will stop boosting the business immediately.")})]}),e.jsxs(B,{children:[e.jsx(F,{children:n("mybusiness.admin.common.cancel","Cancel")}),e.jsx(E,{onClick:p,children:n("mybusiness.admin.featured_placements.cancel_action","Cancel placement")})]})]})}),e.jsx(D,{open:c,onOpenChange:o,children:e.jsxs(T,{children:[e.jsxs(H,{children:[e.jsx(M,{children:n("mybusiness.admin.featured_placements.delete_confirm_title","Delete this placement?")}),e.jsx(k,{children:n("mybusiness.admin.featured_placements.delete_confirm_body","This permanently removes the placement row.")})]}),e.jsxs(B,{children:[e.jsx(F,{children:n("mybusiness.admin.common.cancel","Cancel")}),e.jsx(E,{onClick:_,children:"Delete"})]})]})})]})}function q(){return e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx(ie,{className:"h-10 w-10 text-muted-foreground/50","aria-hidden":!0}),e.jsx("div",{className:"text-sm font-medium text-foreground",children:"No placements"}),e.jsx("div",{className:"max-w-sm text-xs text-muted-foreground",children:"Add sponsored placements to lift businesses in directory listings."})]})}export{qe 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.