PageSourceSearch

https://meetborderless.com/build/assets/index-CxnvlZPC.js

js meetborderless.com collected 2026-10-09 22:42:24 UTC 9,707 bytes, 1 lines download raw bytes

1import{j as e}from"./app-C1iegf7Q.js";import{b as S,H as _,L as o,f as i}from"./inertia-BpyZy4w-.js";import{I as C}from"./input-DJt0nBB3.js";import{S as c,e as m,f as p,a as h,c as n}from"./select-Bn8hgKYl.js";import{a as T}from"./admin-layout-BhXWbUlP.js";import{a as b}from"./utils-BiuKVCuu.js";import{P as A}from"./plus-BJl-aJiX.js";import{S as P}from"./search-BY9GDMxP.js";import{F as D}from"./file-text-XcQuIA-l.js";import{E as R}from"./external-link-avvfS30C.js";import{a as $,T as L}from"./toggle-right-DeJAaLt4.js";import{S as E}from"./square-pen-DgHxGDPS.js";import{T as I}from"./trash-2-CrI9a2Po.js";/* empty css            */import"./index-BdQq_4o_.js";import"./index-Dc_FVRD7.js";import"./index-B0NHTN87.js";import"./index-CGXdj8xB.js";import"./index-C48dRAib.js";import"./index-BDqbV96p.js";import"./index-Cja0wFUH.js";import"./index-CL12STDK.js";import"./Combination-Cr5kvm8y.js";import"./index-C_n-C52S.js";import"./index-D4vO54bj.js";import"./index-BRU_LjHB.js";import"./index-XydtsrKA.js";import"./index-Cs5D2gCo.js";import"./index-DyGg2PJd.js";import"./chevron-down-B1YaU0K5.js";import"./createLucideIcon-wqc1LSWg.js";import"./check-0O-UND6N.js";import"./chevron-up-CLp5HMgA.js";import"./app-logo-Dz0wogSq.js";import"./logo-light-DU4bWymm.js";import"./flash-toast-C6O0iVL1.js";import"./info-D2ZN_yLm.js";import"./triangle-alert-C7AVwNi-.js";import"./circle-x-Bp6Mbpgt.js";import"./circle-check-BMWvzPMx.js";import"./x-DQSeRCcH.js";import"./arrow-left-DCX0fhKH.js";import"./menu-BR3Nc3Gr.js";import"./users-BCcupCXV.js";import"./folder-open-I72SPUVk.js";import"./pound-sterling-D16GLaAZ.js";import"./book-open-DVFlG_9t.js";function Pe({resources:a,stats:d,categories:f,filters:s,types:u,accessLevels:g}){const[j,N]=S.useState(s.search||""),y=t=>{t.preventDefault(),i.get("/admin/resources",{...s,search:j},{preserveState:!0})},r=(t,l)=>{i.get("/admin/resources",{...s,[t]:l||void 0},{preserveState:!0})},k=(t,l)=>{confirm(`Delete "${l}"?`)&&i.delete(`/admin/resources/${t}`,{preserveScroll:!0})},v=t=>{i.patch(`/admin/resources/${t}/toggle-published`,{},{preserveScroll:!0})},w=t=>new Date(t).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}),x=t=>b("rounded-tag px-2.5 py-1 text-xs font-medium transition-colors",t?"bg-ink text-white":"bg-bg-2 text-ink-2 hover:bg-line");return e.jsxs(T,{children:[e.jsx(_,{title:"Resources · Admin"}),e.jsxs("div",{className:"px-4 py-5 sm:px-6 sm:py-7",children:[e.jsxs("div",{className:"mb-5 flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold text-ink",children:"Resources"}),e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:"Manage articles, guides, videos, and other resources"})]}),e.jsxs(o,{href:"/admin/resources/create",className:"inline-flex items-center gap-1.5 rounded-lg bg-ink px-4 py-2 text-sm font-medium text-white hover:bg-ink/90",children:[e.jsx(A,{className:"h-3.5 w-3.5"}),"New resource"]})]}),e.jsx("div",{className:"mb-5 grid grid-cols-3 gap-3",children:[{label:"Total",value:d.total},{label:"Published",value:d.published},{label:"Draft",value:d.draft}].map(t=>e.jsxs("div",{className:"rounded-card border border-line bg-white p-4",children:[e.jsx("p",{className:"text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:t.label}),e.jsx("p",{className:"mt-1.5 font-serif text-3xl leading-none text-ink",children:t.value})]},t.label))}),e.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[e.jsxs("form",{onSubmit:y,className:"relative flex-1 min-w-[180px] max-w-xs",children:[e.jsx(P,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-3"}),e.jsx(C,{type:"search",placeholder:"Search resources...",value:j,onChange:t=>N(t.target.value),className:"h-8 pl-8 text-sm"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",onClick:()=>r("status",null),className:x(!s.status),children:"All"}),e.jsx("button",{type:"button",onClick:()=>r("status","published"),className:x(s.status==="published"),children:"Published"}),e.jsx("button",{type:"button",onClick:()=>r("status","draft"),className:x(s.status==="draft"),children:"Draft"})]}),e.jsxs(c,{value:s.category_id||"all",onValueChange:t=>r("category_id",t==="all"?null:t),children:[e.jsx(m,{className:"h-8 w-[160px] text-sm",children:e.jsx(p,{placeholder:"Category"})}),e.jsxs(h,{children:[e.jsx(n,{value:"all",children:"All categories"}),f.map(t=>e.jsx(n,{value:t.id.toString(),children:t.name},t.id))]})]}),e.jsxs(c,{value:s.type||"all",onValueChange:t=>r("type",t==="all"?null:t),children:[e.jsx(m,{className:"h-8 w-[140px] text-sm",children:e.jsx(p,{placeholder:"Type"})}),e.jsxs(h,{children:[e.jsx(n,{value:"all",children:"All types"}
1),Object.entries(u).map(([t,l])=>e.jsx(n,{value:t,children:l},t))]})]}),e.jsxs(c,{value:s.access_level||"all",onValueChange:t=>r("access_level",t==="all"?null:t),children:[e.jsx(m,{className:"h-8 w-[140px] text-sm",children:e.jsx(p,{placeholder:"Access"})}),e.jsxs(h,{children:[e.jsx(n,{value:"all",children:"All access"}),Object.entries(g).map(([t,l])=>e.jsx(n,{value:t,children:l},t))]})]})]}),e.jsxs("div",{className:"overflow-hidden rounded-card border border-line bg-white",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-line-2 bg-bg-2",children:[e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Resource"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Category"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Type"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Access"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Status"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Created"}),e.jsx("th",{className:"px-4 py-2.5 text-right text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Actions"})]})}),e.jsx("tbody",{children:a.data.length===0?e.jsx("tr",{children:e.jsxs("td",{colSpan:7,className:"py-12 text-center",children:[e.jsx(D,{className:"mx-auto mb-3 h-8 w-8 text-ink-3 opacity-50"}),e.jsx("p",{className:"text-sm text-ink-3",children:"No resources found"})]})}):a.data.map(t=>e.jsxs("tr",{className:"border-b border-line-2 last:border-0 hover:bg-bg-2",children:[e.jsxs("td",{className:"px-4 py-3",children:[e.jsx(o,{href:`/admin/resources/${t.id}/edit`,className:"text-sm font-semibold text-ink hover:underline",children:t.title}),e.jsx("p",{className:"mt-0.5 text-xs text-ink-3",children:t.slug})]}),e.jsx("td",{className:"px-4 py-3",children:t.category?e.jsx("span",{className:"rounded-tag bg-bg-2 px-2 py-0.5 text-2xs font-bold text-ink-2",children:t.category.name}):e.jsx("span",{className:"text-sm text-ink-3",children:"—"})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:"rounded-tag bg-bg-2 px-2 py-0.5 text-2xs font-bold text-ink-3",children:u[t.type]||t.type})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:b("rounded-tag px-2 py-0.5 text-2xs font-bold",t.access_level==="free"?"bg-bg-2 text-ink-3":"bg-lime/20 text-lime-ink"),children:g[t.access_level]||t.access_level})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:b("rounded-tag px-2 py-0.5 text-2xs font-bold",t.is_published?"bg-green/10 text-green-ink":"bg-bg-2 text-ink-3"),children:t.is_published?"Published":"Draft"})}),e.jsx("td",{className:"px-4 py-3 text-sm text-ink-3",children:w(t.created_at)}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex justify-end gap-1.5",children:[e.jsx("a",{href:`/resources/${t.slug}/`,target:"_blank",rel:"noreferrer",className:"flex h-7 w-7 items-center justify-center rounded-md border border-line bg-white text-ink-3 hover:bg-bg-2 hover:text-ink",children:e.jsx(R,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",onClick:()=>v(t.id),title:t.is_published?"Unpublish":"Publish",className:"flex h-7 w-7 items-center justify-center rounded-md border border-line bg-white text-ink-3 hover:bg-bg-2 hover:text-ink",children:t.is_published?e.jsx($,{className:"h-3.5 w-3.5 text-green-ink"}):e.jsx(L,{className:"h-3.5 w-3.5"})}),e.jsx(o,{href:`/admin/resources/${t.id}/edit`,className:"flex h-7 w-7 items-center justify-center rounded-md border border-line bg-white text-ink-3 hover:bg-bg-2 hover:text-ink",children:e.jsx(E,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",onClick:()=>k(t.id,t.title),className:"flex h-7 w-7 items-center justify-center rounded-md border border-line bg-white text-ink-3 hover:border-red/30 hover:bg-red/10 hover:text-red",children:e.jsx(I,{className:"h-3.5 w-3.5"})})]})})]},t.id))})]})}),a.last_page>1&&e.jsxs("div",{className:"flex items-center justify-center gap-3 border-t border-line-2 px-4 py-3",children:[a.current_page>1&&e.jsx("button",{type:"button",onClick:()=>i.get("/admin/resources",{...s,page:a.current_page-1}),className:"text-xs font-medium text-ink-3 hover:text-ink",children:"Previous"}),e.jsxs("span",{className:"text-xs text-ink-3",children:["Page ",a.current_page," of ",a.last_page]}),a.current_page<a.last_page&&e.jsx("button",{type:"button",onClick:()=>i.get("/admin/resources",{...s,page:a.current_page+1}),className:"text-xs font-medium text-ink-3 hover:text-ink",children:"Next"})]})]})]})]})}export{Pe 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.