PageSourceSearch

https://sporthorses.de/assets/StudbookAdmin-Lz5vujM3.js

js sporthorses.de collected 2026-10-08 16:07:04 UTC 4,424 bytes, 1 lines download raw bytes

1import{c as e,b as s,j as a}from"./tanstack-CRmYZZ5E.js";import{r as t}from"./i18n-vendor-DTMAV_9u.js";import{af as r}from"./index-DsumXmnQ.js";import{B as o}from"./button-DMfbGLm9.js";import{B as i}from"./badge-DLILFn4S.js";import{u as l}from"./useToast-CuO6l3By.js";import{a0 as n,ba as d,bh as u,U as c}from"./icons-BBw16cSP.js";import"./react-vendor-CCIm85_W.js";import"./ui-vendor-NEEi_4WX.js";import"./index-8gmUQVmt.js";const m=["nl","nl-be","en","en-us","en-za","de","de-at","de-ch","fr","es","it","pt","pl","sv","no","da","fi","cs","sk","ro","el","hu","ja","zh","ar-ae","ar-qa"];function g(){const{toast:g}=l(),p=e(),[x,f]=t.useState(null),{data:h,isLoading:b}=s({queryKey:["admin-studbook-pages"],queryFn:async()=>{const{data:e,error:s}=await r.from("studbook_pages").select("*").order("name");if(s)throw s;return e||[]}});return b?a.jsx("div",{className:"p-8",children:"Laden…"}):a.jsxs("div",{className:"container mx-auto p-6 max-w-6xl",children:[a.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Stamboekpagina's"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"AI-gegenereerde SEO-landingspagina's per paardenstamboek."}),a.jsx("div",{className:"space-y-3",children:(h||[]).map(e=>{const s=!!e.translations?.[e.source_language],t=e.generated_languages?.length||0,l=x===e.slug;return a.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card flex flex-wrap items-center gap-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-md border border-border bg-muted flex items-center justify-center overflow-hidden shrink-0",children:e.logo_url?a.jsx("img",{src:e.logo_url,alt:e.name,className:"w-full h-full object-contain"}):a.jsx("span",{className:"text-xs text-muted-foreground",children:"Geen logo"})}),a.jsxs("div",{className:"flex-1 min-w-[200px]",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:"font-semibold text-lg",children:e.name}),a.jsx(i,{variant:"published"===e.status?"default":"secondary",children:e.status}),a.jsx(i,{variant:"outline",className:"font-mono text-xs",children:e.slug})]}),a.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[a.jsx(n,{className:"inline w-3 h-3 me-1"}),t," / ",m.length," talen",e.country&&a.jsxs(a.Fragment,{children:[" · ",e.country]})]})]}),a.jsxs("div",{className:"flex gap-2 flex-wrap",children:[a.jsx(o,{size:"sm",variant:"outline",asChild:!0,disabled:l,children:a.jsxs("label",{className:"cursor-pointer",children:[a.jsx(d,{className:"w-4 h-4 me-1"}),e.logo_url?"Vervang logo":"Upload logo",a.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/webp,image/svg+xml",className:"hidden",onChange:s=>{const a=s.target.files?.[0];a&&async function(e,a){f(e.slug);try{const s=a.name.split(".").pop()?.toLowerCase()||"png",t=`${e.slug}-${Date.now()}.${s}`,{error:o}=await r.storage.from("studbook-logos").upload(t,a,{upsert:!0,contentType:a.type});if(o)throw o;const{data:i}=r.storage.from("studbook-logos").getPublicUrl(t),{error:l}=await r.from("studbook_pages").update({logo_url:i.publicUrl}).eq("id",e.id);if(l)throw l;await p.invalidateQueries({queryKey:["admin-studbook-pages"]}),g({title:"Logo geüpload",description:e.name})}catch(s){g({title:"Upload mislukt",description:s instanceof Error?s.message:String(s),variant:"destructive"})}finally{f(null)}}(e,a),s.target.value=""}})]})}),e.logo_url&&a.jsx(o,{size:"sm",variant:"ghost",onClick:()=>async function(e){if(e.logo_url){f(e.slug);try{const s=e.logo_url.split("/studbook-logos/")[1];s&&await r.storage.from("studbook-logos").remove([s]),await r.from("studbook_pages").update({logo_url:null}).eq("id",e.id),await p.invalidateQueries({queryKey:["admin-studbook-pages"]}),g({title:"Logo verwijderd"})}finally{f(null)}}}(e),disabled:l,children:a.jsx(u,{className:"w-4 h-4"})}),s&&a.jsx(o,{size:"sm",variant:"outline",asChild:!0,children:a.jsxs("a",{href:`/stamboek/${e.slug}?preview=1`,target:"_blank",rel:"noreferrer",children:[a.jsx(c,{className:"w-4 h-4 me-1"})," Bekijk"]})}),a.jsx(o,{size:"sm",variant:"published"===e.status?"destructive":"default",onClick:()=>async function(e){const s="published"===e.status?"draft":"published";await r.from("studbook_pages").update({status:s}).eq("id",e.id),await p.invalidateQueries({queryKey:["admin-studbook-pages"]}),g({title:`Status: ${s}`})}(e),disabled:!s,children:"published"===e.status?"Depubliceer":"Publiceer"})]})]},e.id)})})]})}export{g 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.