PageSourceSearch

https://ashkelon.news/assets/admin.authors_._id-Da81XvD4.js

js ashkelon.news collected 2026-09-25 13:36:59 UTC 3,558 bytes, 2 lines download raw bytes

1import{u as U,r as s,d as A,K as r,cr as J,an as O,j as t,cs as Q}from"./index-XdNrAOOz.js";import{A as _,J as q,K as n,i,O as z,Q as G,R as H}from"./ui-dLtj3b-W.js";import{u as V,a as W}from"./use-admin-navigate-BY1g1I9J.js";import"./index-CIzbjd9p.js";function X({author:a}){const o=U(),{goList:I,afterSave:E}=V(),l=!a,[d,F]=s.useState(a?.firstName??""),[m,w]=s.useState(a?.lastName??""),[c,y]=s.useState(a?.title??""),[g,P]=s.useState(a?.biography??""),[p,k]=s.useState(a?.profile??""),[v,D]=s.useState(a?.email??""),[x,M]=s.useState(a?.facebook??""),[j,R]=s.useState(a?.twitter??""),[N,T]=s.useState(a?.instagram??""),[h,K]=s.useState(a?.pinterest??""),[b,$]=s.useState(a?.userId??""),[u,L]=s.useState(a?.remoteId!=null?String(a.remoteId):""),f=A({mutationFn:e=>J({data:{id:a?.id,firstName:d||null,lastName:m||null,title:c||null,biography:g||null,profile:p||null,email:v||null,facebook:x||null,twitter:j||null,instagram:N||null,pinterest:h||null,userId:b||null,remoteId:u===""?null:Number(u)}}),onSuccess:(e,B)=>{r.success(l?"הכותב נוצר":"נשמר בהצלחה"),E({isNew:l,id:e.id,editTo:"/admin/authors/$id",createAnother:B})},onError:e=>r.error(e.message)}),S=A({mutationFn:()=>{if(!a)throw new Error("Missing author");return O({data:{id:a.id}})},onSuccess:()=>{r.success("הכותב נמחק"),I("/admin/authors")},onError:e=>r.error(e.message)}),C=[a?.firstName,a?.lastName].filter(Boolean).join(" ")||a?.id;return t.jsx(_,{children:t.jsxs(q,{title:l?"כותב חדש":"עריכת כותב",description:l?"יצירת פרופיל כותב חדש.":C,onSubmit:e=>{e.preventDefault(),f.mutate(H(e))},footer:t.jsx(G,{saving:f.isPending,onCancel:()=>{o({to:"/admin/authors"})},isNew:l,onDelete:()=>S.mutate(),deletePending:S.isPending,deleteConfirmMessage:`למחוק את הכותב "${C}"?`}),children:[t.jsxs("div",{className:"grid gap-5 sm:grid-cols-2",children:[t.jsx(n,{label:"שם פרטי",children:t.jsx("input",{className:i,value:d,onChange:e=>F(e.target.value)})}),t.jsx(n,{label:"שם משפחה",children:t.jsx("input",{className:i,value:m,onChange:e=>w(e.target.value)})})]}),t.jsx(n,{label:"כותרת",children:t.jsx("input",{className:i,value:c,onChange:e=>y(e.target.value)})}),t.jsx(n,{label:"ביוגרפיה",children:t.jsx("textarea",{className:z,value:g,onChange:e=>P(e.target.value)})}),t.jsx(n,{label:"מזהה תמונת פרופיל",children:t.jsx("input",{className:i,value:p,onChange:e=>k(e.target.value)})}),t.jsx(n,{label:"אימייל",children:t.jsx("input",{type:"email",className:i,value:v,onChange:e=>D(e.target.value)})}),t.jsx(n,{label:"מזהה משתמש בקונסול",children:t.jsx("input",{className:i,value:b,onChange:e=>$(e.target.value),placeholder:"Appwrite user ID",dir:"ltr"})}),t.jsxs("div",{className:"grid gap-5 sm:grid-cols-2",children:[t.jsx(n,{label:"Facebook",children:t.jsx("input",{className:i,value:x,onChange:e=>M(e.target.value)})}),t.jsx(n,{label:"Twitter",children:t.jsx("input",{className:i,value:j,onChange:e=>R(e.target.value)})}),t.jsx(n,{label:"Instagram",children:t.jsx("input",{className:i,value:N,onChange:e=>T(e.target.value)})}),t.jsx(n,{label:"Pinterest",children:t.jsx("input",{className:i,value:h,onChange:e=>K(e.target.value)})})]}),t.jsx(n,{label:"מזהה מרוחק",children:t.jsx("input",{type:"number",className:i,value:u,onChange:e=>L(e.target.value)})})]})})}function ae(){const a=Q.useLoaderData(),o=W(a?`${a.id}:${String(a.updatedAt)}`:void 0);return t.jsx(X,{author:a},o)}export{ae as component};
2//# sourceMappingURL=admin.authors_._id-Da81XvD4.js.map

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.