PageSourceSearch

https://blacksheepbi.com/assets/BrainTransfersLog-BsoYKwHP.js

js blacksheepbi.com collected 2026-09-30 08:26:27 UTC 5,221 bytes, 1 lines download raw bytes

1import{r as x,j as e}from"./ui-CPW3-RCR.js";import{u as I,L as m,i as z,y as N,Z as y,B as n,_ as A,$ as O,N as q,l as C,m as _,n as b,o as w,T as F,q as T,d as i,I as H}from"./index-BraPXa8T.js";import{u as P}from"./useBrainTransfers-B1ZkaAJ5.js";import"./supabase-B2z4OhLQ.js";import"./charts-DCB9_QAo.js";import"./vendor-CIXof4MH.js";const Z={1:"מוח 1 - ידע מרכזי",2:"מוח 2 - סגנון כתיבה",3:"מוח 3 - ידע לקוח"};function V(){const{clearanceLevel:L,loading:B}=I(),p=L===1,{transfers:f,loading:D,editTransfer:k,deleteTransfer:R,restoreTransfer:g}=P(p),[t,c]=x.useState(null),[d,v]=x.useState(""),[u,o]=x.useState(null),[h,j]=x.useState(""),[a,l]=x.useState(!1);if(B)return e.jsx("div",{className:"p-8 flex justify-center",children:e.jsx(m,{className:"w-5 h-5 animate-spin"})});if(!p)return e.jsx("div",{className:"p-8 text-center text-muted-foreground",dir:"rtl",children:"העמוד זמין לניהול מערכת בלבד."});const $=async()=>{if(t){l(!0);try{await k(t,d),i.success("הטקסט עודכן בלוג ובמוח החי"),c(null)}catch(s){i.error(`העדכון נכשל: ${(s==null?void 0:s.message)||"שגיאה"}`)}finally{l(!1)}}},E=async()=>{if(u){l(!0);try{await R(u,h),i.success("הרשומה הוסרה מהמוח וסומנה כמחוקה"),o(null),j("")}catch(s){i.error(`המחיקה נכשלה: ${(s==null?void 0:s.message)||"שגיאה"}`)}finally{l(!1)}}},S=async s=>{l(!0);try{await g(s),i.success("הרשומה שוחזרה והוזרקה מחדש למוח")}catch(r){i.error(`השחזור נכשל: ${(r==null?void 0:r.message)||"שגיאה"}`)}finally{l(!1)}};return e.jsxs("div",{className:"p-4 md:p-6 space-y-4",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"text-xl font-semibold",children:"לוג תגובות למוחות"})]}),D?e.jsx("div",{className:"p-8 flex justify-center",children:e.jsx(m,{className:"w-5 h-5 animate-spin"})}):f.length===0?e.jsx(N,{className:"p-8 text-center text-muted-foreground",children:"אין העברות עדיין."}):e.jsx("div",{className:"space-y-2",children:f.map(s=>{const r=s.status==="deleted";return e.jsxs(N,{className:"p-3 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx("span",{children:new Date(s.created_at).toLocaleString("he-IL")}),e.jsx("span",{children:"·"}),e.jsx("span",{children:s.user_name||"משתמש לא ידוע"}),e.jsx("span",{children:"·"}),e.jsx("span",{children:s.client_name||"ללא לקוח"}),e.jsx(y,{variant:"secondary",children:Z[s.brain_type]||`מוח ${s.brain_type}`}),r&&e.jsx(y,{variant:"destructive",children:"מחוק"})]}),e.jsx("div",{className:`text-sm whitespace-pre-wrap ${r?"line-through opacity-60":""}`,children:s.original_comment_text}),r&&s.delete_reason&&e.jsxs("div",{className:"text-xs text-destructive",children:["סיבת מחיקה: ",s.delete_reason]}),e.jsxs("div",{className:"flex gap-2 pt-1",children:[e.jsxs(n,{size:"sm",variant:"outline",disabled:a,onClick:()=>{c(s),v(s.original_comment_text)},children:[e.jsx(A,{className:"w-3.5 h-3.5 ml-1"}),"עריכה"]}),r?e.jsxs(n,{size:"sm",variant:"outline",disabled:a,onClick:()=>S(s),children:[e.jsx(O,{className:"w-3.5 h-3.5 ml-1"}),"שחזור"]}):e.jsxs(n,{size:"sm",variant:"outline",disabled:a,className:"text-destructive",onClick:()=>{o(s),j("")},children:[e.jsx(q,{className:"w-3.5 h-3.5 ml-1"}),"מחיקה"]})]})]},s.id)})}),e.jsx(C,{open:!!t,onOpenChange:s=>!a&&!s&&c(null),children:e.jsxs(_,{dir:"rtl",children:[e.jsx(b,{children:e.jsx(w,{className:"text-right",children:"עריכת טקסט"})}),e.jsx(F,{value:d,onChange:s=>v(s.target.value),rows:8,className:"text-right"}),e.jsxs(T,{className:"flex-row-reverse sm:flex-row-reverse gap-2",children:[e.jsxs(n,{onClick:$,disabled:a||!d.trim(),children:[a&&e.jsx(m,{className:"w-4 h-4 animate-spin ml-2"}),"שמור"]}),(t==null?void 0:t.status)==="deleted"&&e.jsx(n,{variant:"outline",disabled:a||!d.trim(),onClick:async()=>{if(t){l(!0);try{await g(t,d),i.success("הטקסט עודכן והרשומה שוחזרה למוח"),c(null)}catch(s){i.error(`השחזור נכשל: ${(s==null?void 0:s.message)||"שגיאה"}`)}finally{l(!1)}}},children:"שמור ושחזר למוח"}),e.jsx(n,{variant:"ghost",onClick:()=>c(null),disabled:a,children:"ביטול"})]})]})}),e.jsx(C,{open:!!u,onOpenChange:s=>!a&&!s&&o(null),children:e.jsxs(_,{dir:"rtl",children:[e.jsx(b,{children:e.jsx(w,{className:"text-right",children:"מחיקה מהמוח"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"הרשומה תוסר מהמוח החי ותסומן כמחוקה בלוג. ניתן לשחזר בהמשך."}),e.jsx(H,{value:h,onChange:s=>j(s.target.value),placeholder:"סיבת מחיקה (חובה)",className:"text-right"}),e.jsxs(T,{className:"flex-row-reverse sm:flex-row-reverse gap-2",children:[e.jsxs(n,{variant:"destructive",onClick:E,disabled:a||!h.trim(),children:[a&&e.jsx(m,{className:"w-4 h-4 animate-spin ml-2"}),"מחק"]}),e.jsx(n,{variant:"ghost",onClick:()=>o(null),disabled:a,children:"ביטול"})]})]})})]})}export{V 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.