PageSourceSearch

https://member.ecotourismbali.com/build/assets/CreateQuestion-8ba3b815.js

js ecotourismbali.com collected 2026-09-24 12:24:34 UTC 5,507 bytes, 1 lines download raw bytes

1import{q as E,W as D,r as c,j as t,a as e}from"./app-5bba00c6.js";import{I as n}from"./InputLabel-7aa44422.js";import{B as j}from"./Button-87e6dc81.js";import{T as u}from"./TextInput-ad4901da.js";import{A as Q}from"./AdminLayout-ff2d5404.js";import f from"./TitleSection-27482741.js";import{A as p}from"./AdminSection-b81b79be.js";import{T as L}from"./Table-d1fb9dba.js";import R from"./BackTo-87303903.js";import v from"./Editor-6b59869b.js";import{S as N}from"./SelectInput-b46322eb.js";import{u as V}from"./useTranslation-19967174.js";import"./logo-5e7252b7.js";import"./index-4ed11e56.js";import"./id-410e5203.js";import"./react-responsive-7bae164d.js";import"./index-25fc1de7.js";function ae({assess_question:x,assessment:a,product_categories:q}){var _;const{t:o}=V(),{flash:g}=E().props,{data:r,setData:i,post:y,processing:w,errors:s,reset:k}=D({question_no:"",question:"",question_en:"",title:"",title_en:"",type:"radio",product_category_id:null}),C=["Question No","Title","Question","Option","Action"],F=["question_no","title","question"],S=[{label:"add_option",link:"/admin/assessment/",link2:"/option",withId:!0}],T=[{label:"edit_button",link:"/admin/assessment/question/edit",withId:!0,color:"info"},{label:"delete_button",route:"assessment_question.destroy",withId:!0,color:"danger",type:"delete"}],I=l=>{l.preventDefault(),y(route("assessment_question.store",a.id),{onSuccess:()=>{k(),h(""),b("")}})},A=l=>"/storage/"+l,[d,h]=c.useState(""),[m,b]=c.useState("");c.useEffect(()=>{i("question",d)},[d]),c.useEffect(()=>{i("question_en",m)},[m]);const B=[{label:"Radio Button",value:"radio"},{label:"Checkbox",value:"checkbox"},{label:"Radio Button + Checkbox",value:"combo"}];return t(Q,{children:[e(R,{title:"back_to_list_assessment",link:"/admin/assessment"}),t(p,{className:"mb-6 flex items-center",children:[e("img",{src:A("assessments/"+(a==null?void 0:a.image)),alt:a.title,className:"w-16 h-16 mr-4 object-cover rounded-lg"}),e("h4",{className:"font-bold text-lg",children:a.title})]}),t(p,{className:"flex flex-col gap-6 mb-6",children:[e(f,{title:"create_question_title"}),g.success&&t("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative",children:[e("strong",{className:"font-bold mr-2",children:"Success!"}),e("span",{className:"inline",children:g.success})]}),t("form",{className:"flex flex-col gap-6",onSubmit:I,children:[t("div",{className:"block lg:flex items-center",children:[e("div",{className:"lg:w-1/5 mb-2 lg:mb-0",children:e(n,{htmlFor:"question_no",value:o("form_label_question_no")})}),t("div",{className:"lg:w-4/5",children:[e(u,{id:"question_no",name:"question_no",type:"number",value:r.question_no,className:"block w-full",isFocused:!0,min:"1",onChange:l=>i("question_no",l.target.value)}),e("span",{className:"text-red-600",children:s.question_no})]})]}),t("div",{className:"block lg:flex items-center",children:[e("div",{className:"lg:w-1/5 mb-2 lg:mb-0",children:e(n,{htmlFor:"title",value:o("form_label_title")})}),t("div",{className:"lg:w-4/5",children:[e(u,{id:"title",name:"title",type:"text",value:r.title,className:"block w-full",isFocused:!0,onChange:l=>i("title",l.target.value)}),e("span",{className:"text-red-600",children:s.title})]})]}),t("div",{className:"block lg:flex items-center",children:[e("div",{className:"lg:w-1/5 mb-2 lg:mb-0",children:e(n,{htmlFor:"title_en",value:o("form_label_title_en")})}),t("div",{className:"lg:w-4/5",children:[e(u,{id:"title_en",name:"title_en",type:"text",value:r.title_en,className:"block w-full",isFocused:!0,onChange:l=>i("title_en",l.target.value)}),e("span",{className:"text-red-600",children:s.title_en})]})]}),t("div",{className:"block lg:flex items-center",children:[e("div",{className:"lg:w-1/5 mb-2 lg:mb-0",children:e(n,{htmlFor:"type",value:o("form_label_type")})}),t("div",{className:"lg:w-4/5",children:[e(N,{id:"type",name:"type",value:r.type,options:B,className:"w-full",onChange:l=>i("type",l.target.value)}),e("span",{className:"text-red-600",children:s.type})]})]}),((_=a==null?void 0:a.business_type)==null?void 0:_.name)==="Supplier"&&t("div",{className:"block lg:flex items-center",children:[e("div",{className:"lg:w-1/5 mb-2 lg:mb-0",children:e(n,{htmlFor:"product_category",value:o("form_label_product_category")})}),t("div",{className:"lg:w-4/5",children:[e(N,{id:"product_category",name:"product_category",value:r.product_category_id,options:q,className:"w-full",labelData:"name",valueData:"id",placeholder:"select_product_category",onChange:l=>i("product_category_id",l.target.value)}),e("span",{className:"text-red-600",children:s.product_category_id})]})]}),t("div",{className:"block lg:flex items-center",children:[e("div",{className:"lg:w-1/5 mb-2 lg:mb-0",children:e(n,{htmlFor:"question",value:o("form_label_question")})}),t("div",{className:"lg:w-4/5",children:[e(v,{onChange:h,value:d}),e("span",{className:"text-red-600",children:s.question})]})]}),t("div",{className:"block lg:flex items-center",children:[e("div",{className:"lg:w-1/5 mb-2 lg:mb-0",children:e(n,{htmlFor:"question_en",value:o("form_label_question_en")})}),t("div",{className:"lg:w-4/5",children:[e(v,{onChange:b,value:m}),e("span",{className:"text-red-600",children:s.question_en})]})]}),e(j,{color:"secondary",className:"w-fit",disabled:w,children:o("submit")})]})]}),t(p,{className:"flex flex-col gap-6",children:[e(f,{title:"list_question_title"}),e(L,{header:C,data:x,selectedData:F,tableButtons:S,tableActions:T,descHtml:"question"})]})]})}export{ae 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.