PageSourceSearch

https://wash.tsunamiexpress.com/build/assets/CategoriesPage-CY62nk7h.js

js tsunamiexpress.com collected 2026-10-08 03:00:48 UTC 3,302 bytes, 1 lines download raw bytes

1import{b as g,u as p,r as c,j as e,H as u}from"./app-Vm5ePdMG.js";import{B as h}from"./Breadcrumb-DJLvcesX.js";import{T as i}from"./TextInput-BF2h3iqy.js";import{Y as b}from"./YellowButton-C9Op8ZlW.js";import{A as y}from"./AdminLayout-MC4rkiS8.js";import{n as j}from"./notifyError-LMiWbqVb.js";import{n as f}from"./notifySuccess-C3_w1O95.js";import{s as k}from"./slugify-EySu1-1N.js";/* empty css            */import"./ChevronDownIcon-rhZzBZfS.js";import"./index-CNBnketN.js";function H({categories:o}){const{success:s,errors:t}=g().props,{post:m,data:a,setData:d,reset:n,processing:l}=p({name:"",slug:""});c.useEffect(()=>{s?.saveCat&&f(s.saveCat),t?.saveCat&&j(t.saveCat)},[s,t]),c.useEffect(()=>{d("slug",k(a.name))},[a.name]);const x=r=>{r.preventDefault(),m("/admin/category/create",{onSuccess:()=>{n()}})};return e.jsxs(y,{children:[e.jsx(u,{children:e.jsx("title",{children:"Categories"})}),e.jsx(h,{pageName:"Categories"}),e.jsxs("div",{className:"bg-white dark:bg-boxdark rounded-lg border border-stroke dark:border-strokedark p-6 mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Add New Category"}),e.jsxs("form",{onSubmit:x,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block mb-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:"Category Name"}),e.jsx(i,{name:"name",value:a.name,onChange:r=>d("name",r.target.value),placeholder:"e.g., Membership, Gift Cards",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block mb-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:"Slug"}),e.jsx(i,{name:"slug",value:a.slug,onChange:r=>d("slug",r.target.value),placeholder:"auto-generated from name",required:!0}),e.jsx("small",{className:"text-gray-500 dark:text-gray-400",children:"Slug is used to construct the URL"})]}),e.jsx(b,{type:"submit",disabled:l,children:l?"Adding...":"Add Category"})]})]}),e.jsxs("div",{className:"bg-white dark:bg-boxdark rounded-lg border border-stroke dark:border-strokedark",children:[e.jsx("div",{className:"p-6 border-b border-stroke dark:border-strokedark",children:e.jsx("h2",{className:"text-xl font-semibold",children:"Categories"})}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm text-left",children:[e.jsx("thead",{className:"text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-6 py-3",children:"Category Name"}),e.jsx("th",{scope:"col",className:"px-6 py-3",children:"Slug"}),e.jsx("th",{scope:"col",className:"px-6 py-3",children:"Created At"})]})}),e.jsx("tbody",{children:o.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:3,className:"px-6 py-8 text-center text-gray-500",children:"No categories yet. Add your first category above."})}):o.map(r=>e.jsxs("tr",{className:"border-b dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600",children:[e.jsx("td",{className:"px-6 py-4 font-medium text-gray-900 dark:text-white",children:r.name}),e.jsx("td",{className:"px-6 py-4 text-gray-700 dark:text-gray-300",children:r.slug}),e.jsx("td",{className:"px-6 py-4 text-gray-700 dark:text-gray-300",children:new Date(r.created_at).toLocaleDateString()})]},r.id))})]})})]})]})}export{H 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.