PageSourceSearch

https://eyalyossinger.com/assets/AdminSketches-Dpb7X026.js

js eyalyossinger.com collected 2026-10-04 05:36:50 UTC 2,517 bytes, 1 lines download raw bytes

1import{x as m,y as u,j as e,B as r,w as i,z as x,s as n,v as l}from"./index-CXI8pUF1.js";import{u as h}from"./useQuery-B1gnfsZf.js";import{C as j,a as f}from"./card-BMRakZrF.js";import{S as p}from"./skeleton-Cl6rPsjd.js";import{U as N}from"./upload-B8AhNjoX.js";import{S as y}from"./square-pen-DZphM6dv.js";import{T as v}from"./trash-2-DnLUGboj.js";const z=()=>{const c=m(),{data:t,isLoading:o}=h({queryKey:["admin-sketches"],queryFn:async()=>{const{data:s,error:a}=await n.from("sketches").select("*").order("created_at",{ascending:!1});if(a)throw a;return s}}),d=u({mutationFn:async s=>{const{error:a}=await n.from("sketches").delete().eq("id",s);if(a)throw a},onSuccess:()=>{c.invalidateQueries({queryKey:["admin-sketches"]}),l.success("הסקיצה נמחקה")},onError:s=>l.error("שגיאה: "+s.message)});return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"font-heebo text-2xl font-bold",children:"ניהול סקיצות"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(r,{variant:"outline",asChild:!0,children:e.jsxs(i,{to:"/admin/sketches/bulk",children:[e.jsx(N,{className:"ml-2 h-4 w-4"}),"העלאה מרובה"]})}),e.jsx(r,{asChild:!0,children:e.jsxs(i,{to:"/admin/sketches/new",children:[e.jsx(x,{className:"ml-2 h-4 w-4"}),"סקיצה חדשה"]})})]})]}),o?e.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((s,a)=>e.jsx(p,{className:"h-20 w-full"},a))}):e.jsxs("div",{className:"space-y-3",children:[t==null?void 0:t.map(s=>e.jsx(j,{children:e.jsxs(f,{className:"flex items-center gap-4 p-4",children:[s.image&&e.jsx("img",{src:s.image,alt:"",className:"h-16 w-24 rounded object-cover"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-heebo font-semibold truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:s.description})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(r,{variant:"outline",size:"sm",asChild:!0,children:e.jsx(i,{to:`/admin/sketches/${s.id}`,children:e.jsx(y,{className:"h-4 w-4"})})}),e.jsx(r,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>{confirm("למחוק את הסקיצה?")&&d.mutate(s.id)},children:e.jsx(v,{className:"h-4 w-4"})})]})]})},s.id)),(t==null?void 0:t.length)===0&&e.jsx("p",{className:"py-12 text-center text-muted-foreground",children:"אין סקיצות עדיין"})]})]})};export{z 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.