PageSourceSearch

https://smartedu.ai/build/assets/CreateForm-_FheFAc7.js

js smartedu.ai collected 2026-10-05 15:06:48 UTC 2,174 bytes, 1 lines download raw bytes

1import{i as o,t as m}from"./react-C6JdJxIB.js";import{t as p}from"./jsx-runtime-CGXBp6bb.js";import{t as u}from"./FormOffcanvas-Dh4a-3SG.js";var j=o(m(),1),r=p(),x=[{name:"name",label:"Name",required:!0,translatable:!0},{name:"key",label:"Feature Key",required:!0,placeholder:"courses.create"},{name:"description",label:"Description",type:"textarea",placeholder:"Optional description"},{name:"is_active",label:"Active",type:"checkbox",checkboxLabel:"Active"}];function b({tenantTypes:l=[],value:i=[],onChange:t,error:n}){const a=Array.isArray(i)?i.map(s=>Number(s)):[],c=s=>{const e=Number(s);t(a.includes(e)?a.filter(d=>d!==e):[...a,e])};return(0,r.jsxs)("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-4",children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-2",children:[(0,r.jsx)("p",{className:"mb-0 text-sm font-semibold text-slate-800",children:"Tenant Types"}),(0,r.jsxs)("span",{className:"rounded-full border border-slate-200 bg-white px-2 py-1 text-xs text-slate-500",children:[a.length," selected"]})]}),(0,r.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:l.map(s=>{const e=a.includes(Number(s.id));return(0,r.jsxs)("label",{className:`flex cursor-pointer items-start gap-2 rounded-xl border px-3 py-2 ${e?"border-indigo-300 bg-indigo-50":"border-slate-200 bg-white"}`,children:[(0,r.jsx)("input",{type:"checkbox",className:"mt-1",checked:e,onChange:()=>c(s.id)}),(0,r.jsx)("span",{className:"text-sm text-slate-700",children:s.name})]},s.id)})}),n&&(0,r.jsx)("p",{className:"mt-2 text-xs text-rose-600",children:n})]})}function y({isOpen:l,onClose:i,form:t,languages:n,tenantTypes:a,title:c="Add Feature",submitLabel:s="Create Feature"}){return(0,r.jsx)(u,{isOpen:l,onClose:i,title:c,fields:x.map(e=>e.translatable?{...e,languages:n}:e),data:t.data,setData:(e,d)=>t.setData(e,d),onSubmit:e=>{e.preventDefault(),t.post(route("admin.features.store"),{onSuccess:()=>{i(),t.reset()}})},processing:t.processing,errors:t.errors,submitLabel:s,children:(0,r.jsx)(b,{tenantTypes:a,value:t.data.tenant_type_ids,onChange:e=>t.setData("tenant_type_ids",e),error:t.errors.tenant_type_ids})})}export{y 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.