PageSourceSearch

https://connectability.org.au/assets/ServicePageManager-CSl3UVsM.js

js connectability.org.au collected 2026-10-04 12:24:21 UTC 5,043 bytes, 5 lines download raw bytes

1import{j as e,t as h,b as N,r as l}from"./index-BvRsuVmD.js";import{B as p}from"./button-bd0fMgdA.js";import{I as S}from"./input-B1badspI.js";import{L as c}from"./label-LiUD-mS8.js";import{T as k}from"./textarea-175LE2zy.js";import{C as J,a as A}from"./card-DrzGSSp7.js";import{T as M,a as R,b as z,c as B}from"./tabs-DI3lVR7P.js";import{R as T}from"./RichTextEditor-yAplP-JP.js";import{F as H}from"./file-text-BEvnD_mM.js";import{S as U}from"./save-DcPIE1Qt.js";import{P as F}from"./plus-BtlRfdf9.js";import{T as O}from"./trash-2-D076Wth9.js";import"./dialog-rRhlRxHu.js";import"./x-RRihKzrC.js";import"./useComposition-DPYcD6wl.js";import"./index-CjAD2kb7.js";import"./list-BBsW7vO-.js";import"./quote-BvaG5m_R.js";import"./Admin-B8HO--Jd.js";import"./clock-Bf79IV2W.js";import"./download-BiuyLkf2.js";import"./house-D8NjdNl9.js";import"./type-BBOsViDt.js";import"./external-link-CQXI3BRA.js";import"./users-C4rce50_.js";import"./calendar-BoFrUT_u.js";import"./phone-yful1FiG.js";import"./message-square-warning-BPlU1W_E.js";const y=[{slug:"allied-health",label:"Allied Health"},{slug:"plan-management",label:"Plan Management"},{slug:"community-programs",label:"Community Programs"},{slug:"early-intervention",label:"Early Intervention"},{slug:"support-coordination",label:"Support Coordination"},{slug:"youth-services",label:"Youth Services"},{slug:"careers",label:"Careers"},{slug:"testimonials",label:"Testimonials"}];function V({slug:s,label:m}){const{data:n,isLoading:C}=h.servicePage.get.useQuery({slug:s}),d=h.servicePage.update.useMutation({onSuccess:()=>{N.success(`${m} page updated!`),P.servicePage.get.invalidate({slug:s})},onError:t=>N.error(t.message)}),P=h.useUtils(),[g,j]=l.useState(""),[f,v]=l.useState(""),[r,o]=l.useState([]);l.useEffect(()=>{if(n&&(j(n.pageTitle||""),v(n.introText||""),n.sectionsJson))try{o(JSON.parse(n.sectionsJson))}catch{}},[n]);const I=()=>{d.mutate({slug:s,pageTitle:g||void 0,introText:f||void 0,sectionsJson:r.length>0?JSON.stringify(r):void 0})},x=(t,a,i)=>{o(u=>u.map((b,L)=>L===t?{...b,[a]:i}:b))},w=()=>{o(t=>[...t,{heading:"",body:"",listItems:[]}])},E=t=>{o(a=>a.filter((i,u)=>u!==t))};return C?e.jsx("div",{className:"py-8 text-center text-muted-foreground",children:"Loading..."}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"font-semibold",children:m}),e.jsxs(p,{size:"sm",onClick:I,disabled:d.isPending,children:[e.jsx(U,{className:"w-4 h-4 mr-2"}),d.isPending?"Saving...":"Save"]})]}),e.jsxs("div",{children:[e.jsx(c,{children:"Page Title"}),e.jsx(S,{value:g,onChange:t=>j(t.target.value),placeholder:m})]}),e.jsxs("div",{children:[e.jsx(c,{children:"Intro Text"}),e.jsx(T,{content:f,onChange:v,minHeight:"120px"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Use the toolbar to format text with bold, italic, links, headings, and lists."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(c,{className:"text-sm font-semibold",children:"Content Sections"}),e.jsxs(p,{variant:"outline",size:"sm",onClick:w,children:[e.jsx(F,{className:"w-3 h-3 mr-1"})," Add Section"]})]}),r.map((t,a)=>e.jsxs("div",{className:"border rounded-lg p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Section ",a+1]}),e.jsx(p,{variant:"ghost",size:"sm",onClick:()=>E(a),children:e.jsx(O,{className:"w-3 h-3 text-red-500"})})]}),e.jsx(S,{value:t.heading,onChange:i=>x(a,"heading",i.target.value),placeholder:"Section heading",className:"text-sm"}),e.jsx(T,{content:t.body,onChange:i=>x(a,"body",i),minHeight:"100px"}),e.jsxs("div",{children:[e.jsx(c,{className:"text-xs",children:"List Items (one per line)"}),e.jsx(k,{value:(t.listItems||[]).join(`
2`),onChange:i=>x(a,"listItems",i.target.value.split(`
3`).filter(Boolean)),rows:3,placeholder:`Item 1
4Item 2
5Item 3`,className:"text-xs"})]})]},a)),r.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No custom sections yet. The page will use its default content. Add sections to override."})]})]})}function je(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-xl font-bold flex items-center gap-2",children:[e.jsx(H,{className:"w-5 h-5"})," Service Sub-Pages"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Edit the title, intro text, and content sections for each individual service page. Use the rich text editor to format text with bold, italic, links, headings, and lists."})]}),e.jsxs(M,{defaultValue:"allied-health",children:[e.jsx(R,{className:"flex flex-wrap h-auto gap-1",children:y.map(s=>e.jsx(z,{value:s.slug,className:"text-xs",children:s.label},s.slug))}),y.map(s=>e.jsx(B,{value:s.slug,children:e.jsx(J,{children:e.jsx(A,{className:"pt-6",children:e.jsx(V,{slug:s.slug,label:s.label})})})},s.slug))]})]})}export{je 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.