Files
soorya-carpet/public/build/assets/add-CtZCjhMZ.js
admin eba9e5f182
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
chore: frontend build
2025-10-27 15:27:26 +05:45

2 lines
1.8 KiB
JavaScript

import{u as m,j as s,H as c}from"./app-C6SiEMGn.js";import{B as p}from"./createLucideIcon-CPpF-2ww.js";import{I as i}from"./input-DYhKGVpQ.js";import{L as l}from"./label-BB9HLxkE.js";import{A as x,d as f}from"./app-layout-B4kweoSW.js";import{t as h,r as g,p as j,a as b}from"./index-BQ4sA8lt.js";import"./app-6D7Y1jSv.js";import"./index-B7t1D_co.js";import"./sheet-BvPq5L9Z.js";import"./index-FUlYkgbj.js";import"./index-CxjaVpyF.js";import"./app-logo-icon-B_KiS1IV.js";import"./package-DTdg9l_D.js";g(j,b);function C(){const{data:a,setData:r,post:n,processing:o,errors:t,wasSuccessful:d}=m({question:"",answer:""}),u=e=>{e.preventDefault(),n(f.faq.addFaq().url,{forceFormData:!0}),d&&h.success("Product added successfully")};return s.jsxs(x,{children:[s.jsx(c,{title:"Add FAQ Questions"}),s.jsxs("section",{className:"flex flex-col gap-8 px-8 py-8",children:[s.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:"Add FAQ Questions"}),s.jsxs("form",{onSubmit:u,method:"POST",encType:"multipart/formdata",className:"flex flex-col items-start gap-4",children:[s.jsxs("div",{className:"flex w-full flex-col gap-2",children:[s.jsx(l,{htmlFor:"question",children:"Question"}),s.jsx(i,{type:"text",id:"question",value:a.question,onChange:e=>r("question",e.target.value),className:"rounded border p-2"}),t.question&&s.jsx("span",{className:"text-red-600",children:t.question})]}),s.jsxs("div",{className:"flex w-full flex-col gap-2",children:[s.jsx(l,{htmlFor:"answer",children:"Answer"}),s.jsx(i,{type:"text",id:"answer",value:a.answer,onChange:e=>r("answer",e.target.value),className:"rounded border p-2"}),t.answer&&s.jsx("span",{className:"text-red-600",children:t.answer})]}),s.jsx(p,{type:"submit",disabled:o,className:"cursor-pointer",children:o?"submitting...":"Submit"})]})]})]})}export{C as default};