PageSourceSearch

https://tailwindadmin-tanstack-pro-dark.netlify.app/assets/create-BM_RoR13.js

js tailwindadmin-tanstack-pro-dark.netlify.app collected 2026-10-03 11:32:35 UTC 4,295 bytes, 1 lines download raw bytes

1import{r as s,u as I,j as e}from"./main-BkpAS6Tt.js";import{T as y,a as A}from"./index-Be6mzESx.js";import{C as M}from"./CardBox-CY_4CfKs.js";import{L as k}from"./label-Be_2bmKI.js";import{I as v}from"./input-D3PXSnUk.js";import{D as E,a as F,b as B,o as L,c as O}from"./dropdown-menu-CLPKr1dO.js";import{B as c}from"./button-CVuE7h15.js";import{A as P,a as J,b as R}from"./avatar-Da6FP_Y6.js";import{B as H}from"./BreadcrumbComp-DdXArMCY.js";import{h as V,f as q}from"./format-CNjrC8BB.js";import{C as z}from"./chevron-down-ChXj5Bit.js";import"./_commonjsHelpers-CE1G-McA.js";import"./chance-BLY6SEPW.js";import"./card-DoRMGzGn.js";import"./utils-4perknFd.js";import"./index-QqyytP6n.js";import"./index-L0SKbviM.js";import"./index-Cft9Cwv8.js";import"./index-DRcYnjBa.js";import"./index-CfThMl9f.js";import"./index-DhQbCedW.js";import"./index-Jo9Y0u8a.js";import"./index-BHinUB-C.js";import"./index-aJTH1M9Z.js";import"./tslib.es6-CmEaCU22.js";import"./index-DfANd6nE.js";import"./index-Ddz03csu.js";import"./floating-ui.dom-D7G01c1r.js";import"./index-B_H36sPx.js";import"./index-DjxFjNHx.js";import"./index-C0QJ8CHZ.js";import"./chevron-right-DFxpASjY.js";import"./createLucideIcon-DRlH1f4M.js";import"./check-DIOPK-zC.js";import"./circle-DoQ76Nbd.js";import"./index-Bj56izVu.js";import"./en-US-Dw4dfe3S.js";import"./toDate-BK_JsdFu.js";const i=[{id:1,name:"Liam",photo:"/images/profile/user-1.jpg"},{id:2,name:"Steve",photo:"/images/profile/user-2.jpg"},{id:3,name:"Jack",photo:"/images/profile/user-3.jpg"},{id:4,name:"John",photo:"/images/profile/user-8.jpg"}],G=[{to:"/",title:"Home"},{title:"Tickets"}],K=()=>{const{tickets:m,addTicket:D}=s.useContext(y),[r,l]=s.useState(void 0),[o,T]=s.useState(new Date().toISOString().split("T")[0]),[a,d]=s.useState(""),[n,p]=s.useState(""),[h,x]=s.useState(i[0]),[b,u]=s.useState(i[0].photo),j=I();s.useEffect(()=>{const t=m.reduce((g,f)=>f.Id>g?f.Id:g,0);l(t+1)},[m]);const w=()=>{if(!a||!n){alert("Please fill out all fields.");return}const t={Id:r,ticketTitle:a,ticketDescription:n,Status:"Open",Label:"primary",thumb:b,AgentName:h.name,Date:new Date(o),deleted:!1};D(t),C(),j({to:"/apps/tickets"})},C=()=>{l(void 0),T(new Date().toISOString().split("T")[0]),d(""),p(""),x(i[0]),u(i[0].photo)},N=V(new Date(o))?new Date(o):new Date,S=q(N,"EEEE, MMMM dd, yyyy");return e.jsx(e.Fragment,{children:e.jsxs(A,{children:[e.jsx(H,{title:"Tickets App",items:G}),e.jsxs(M,{children:[e.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Create New Ticket"}),e.jsxs("p",{children:["ID : ",r!==void 0?r:""]}),e.jsxs("p",{children:["Date : ",S]}),e.jsxs("div",{className:"bg-lightgray dark:bg-gray-800/70 p-6 my-6 rounded-md",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 block",children:e.jsx(k,{htmlFor:"ticketTitle",children:"Ticket Title"})}),e.jsx(v,{id:"ticketTitle",value:a,onChange:t=>d(t.target.value),placeholder:"Ticket Title",className:"w-full form-control"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 block",children:e.jsx(k,{htmlFor:"ticketDescription",children:"Ticket Description"})}),e.jsx(v,{id:"ticketDescription",value:n,onChange:t=>p(t.target.value),placeholder:"Ticket Description",className:"w-full form-control"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between mt-6 gap-3",children:[e.jsx("div",{children:e.jsxs(E,{children:[e.jsx(F,{asChild:!0,children:e.jsxs(c,{variant:"default",className:"rounded-md",children:[h.name,e.jsx(z,{className:"h-4 w-4 ml-1"})]})}),e.jsxs(B,{className:"rounded-md",children:[e.jsx(L,{children:"Select Agent"}),i.map(t=>e.jsx(O,{onClick:()=>{x(t),u(t.photo)},children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(P,{className:"h-6 w-6",children:[e.jsx(J,{src:t.photo}),e.jsx(R,{children:t.name.charAt(0)})]}),e.jsx("span",{children:t.name})]})},t.id))]})]})}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(c,{className:"rounded-md bg-primary text-white hover:bg-primary/90",onClick:w,children:"Save"}),e.jsx(c,{className:"rounded-md bg-red-500 text-white hover:bg-red-600",onClick:()=>j({to:"/apps/tickets"}),children:"Cancel"})]})]})]})]})]})})};function Ae(){return e.jsx(e.Fragment,{children:e.jsx(K,{})})}
1export{Ae as component};

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.