PageSourceSearch

https://maverickx.io/assets/NavigationEditor-BHjEuBq9.js

js maverickx.io collected 2026-10-04 03:55:30 UTC 4,717 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-ui-CBu0Vw34.js";import{r as v}from"./vendor-react-s33YTJSM.js";import{Z as y,B as u,V as i,$ as F}from"./index-8QsIOkks.js";import{P as f}from"./plus-Co_Y_wJ5.js";import{T as N}from"./trash-2-1ahGxauY.js";const A=()=>{const{content:m,updateSection:h}=y(),[n,d]=v.useState(m.nav),[l,c]=v.useState(m.footer);v.useEffect(()=>{d(m.nav),c(m.footer)},[m.nav,m.footer]);const p=()=>{h("nav",n),h("footer",l),F({title:"Saved!",description:"Navigation and footer updated successfully."})},g=(s,t,a)=>{const o=[...n.items];o[s]={...o[s],[t]:a},d({...n,items:o})},b=()=>{const s={id:`nav-${Date.now()}`,label:"New Link",url:"#"};d({...n,items:[...n.items,s]})},C=s=>{d({...n,items:n.items.filter((t,a)=>a!==s)})},k=(s,t,a)=>{const o=[...l.columns];o[s]={...o[s],[t]:a},c({...l,columns:o})},j=(s,t,a,o)=>{const r=[...l.columns],x=[...r[s].links];x[t]={...x[t],[a]:o},r[s]={...r[s],links:x},c({...l,columns:r})},w=s=>{const t=[...l.columns];t[s].links.push({label:"New Link",url:"#"}),c({...l,columns:t})},L=(s,t)=>{const a=[...l.columns];a[s].links=a[s].links.filter((o,r)=>r!==t),c({...l,columns:a})};return e.jsxs("div",{className:"p-8 max-w-4xl",children:[e.jsxs("div",{className:"mb-8 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Navigation & Footer"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Edit navigation and footer content"})]}),e.jsx(u,{variant:"pill",onClick:p,children:"Save Changes"})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"card-elevated p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Top Navigation"}),e.jsxs(u,{variant:"pillOutline",size:"sm",onClick:b,children:[e.jsx(f,{className:"h-4 w-4 mr-1"})," Add Item"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Logo Text"}),e.jsx(i,{value:n.logo,onChange:s=>d({...n,logo:s.target.value}),className:"rounded-xl"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Nav Items"}),n.items.map((s,t)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(i,{value:s.label,onChange:a=>g(t,"label",a.target.value),placeholder:"Label",className:"rounded-xl flex-1"}),e.jsx(i,{value:s.url,onChange:a=>g(t,"url",a.target.value),placeholder:"URL",className:"rounded-xl flex-1"}),e.jsx(u,{variant:"ghost",size:"icon",onClick:()=>C(t),className:"text-destructive",children:e.jsx(N,{className:"h-4 w-4"})})]},s.id))]})]}),e.jsxs("div",{className:"card-elevated p-6 space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Footer Settings"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Language"}),e.jsx(i,{value:l.language,onChange:s=>c({...l,language:s.target.value}),className:"rounded-xl"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Network Text"}),e.jsx(i,{value:l.networkText,onChange:s=>c({...l,networkText:s.target.value}),className:"rounded-xl"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Footer Logo"}),e.jsx(i,{value:l.logo,onChange:s=>c({...l,logo:s.target.value}),className:"rounded-xl"})]})]}),l.columns.map((s,t)=>e.jsxs("div",{className:"card-elevated p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground",children:["Footer Column: ",s.title]}),e.jsxs(u,{variant:"pillOutline",size:"sm",onClick:()=>w(t),children:[e.jsx(f,{className:"h-4 w-4 mr-1"})," Add Link"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Column Title"}),e.jsx(i,{value:s.title,onChange:a=>k(t,"title",a.target.value),className:"rounded-xl"})]}),e.jsx("div",{className:"space-y-2",children:s.links.map((a,o)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(i,{value:a.label,onChange:r=>j(t,o,"label",r.target.value),placeholder:"Label",className:"rounded-xl flex-1"}),e.jsx(i,{value:a.url,onChange:r=>j(t,o,"url",r.target.value),placeholder:"URL",className:"rounded-xl flex-1"}),e.jsx(u,{variant:"ghost",size:"icon",onClick:()=>L(t,o),className:"text-destructive",children:e.jsx(N,{className:"h-4 w-4"})})]},o))})]},s.id))]})]})};export{A 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.