Files
turftracker/frontend/dist/assets/Equipment-CTLZqt7C.js
2026-04-09 13:19:47 -05:00

2 lines
39 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{r as o,t as k,z as h,j as e,L,f as V,b as E,v as ie,q as ce,s as _,x as w}from"./index-9FS9bw8D.js";import{F as oe}from"./MagnifyingGlassIcon-DIIDUrHz.js";const xe=()=>{const[p,a]=o.useState([]),[m,y]=o.useState([]),[S,b]=o.useState([]),[s,n]=o.useState(!0),[v,g]=o.useState(!1),[f,t]=o.useState(!1),[d,r]=o.useState(null),[i,N]=o.useState(""),[j,c]=o.useState(""),[x,C]=o.useState(!1),[F,A]=o.useState("all"),[W,T]=o.useState(!1),[M,P]=o.useState(!1),[I,G]=o.useState(null),[R,H]=o.useState(null);o.useEffect(()=>{z()},[]);const z=async()=>{try{n(!0);const[l,u,D]=await Promise.all([k.getAll({category_id:i,is_active:!x}),k.getCategories(),k.getTypes()]);a(l.data.data.equipment||[]),y(u.data.data.categories||[]),b(D.data.data.equipmentTypes||[])}catch(l){console.error("Failed to fetch equipment:",l),h.error("Failed to load equipment"),a([]),y([]),b([])}finally{n(!1)}},Z=l=>{c(l.target.value)},O=()=>{z()},K=async l=>{try{await k.create(l),h.success("Equipment created successfully!"),g(!1),z()}catch(u){console.error("Failed to create equipment:",u),h.error("Failed to create equipment")}},X=l=>{r(l),t(!0)},q=async l=>{try{await k.update(d.id,l),h.success("Equipment updated successfully!"),t(!1),r(null),z()}catch(u){console.error("Failed to update equipment:",u),h.error("Failed to update equipment")}},ee=async l=>{if(window.confirm("Are you sure you want to delete this equipment?"))try{await k.delete(l),h.success("Equipment deleted successfully"),z()}catch(u){console.error("Failed to delete equipment:",u),h.error("Failed to delete equipment")}},se=l=>{G(l),T(!0)},ae=l=>{H(l),P(!0)},B=p.filter(l=>{var D,$,U,Q,Y;const u=j===""||((D=l.customName)==null?void 0:D.toLowerCase().includes(j.toLowerCase()))||(($=l.typeName)==null?void 0:$.toLowerCase().includes(j.toLowerCase()))||((U=l.manufacturer)==null?void 0:U.toLowerCase().includes(j.toLowerCase()))||((Q=l.model)==null?void 0:Q.toLowerCase().includes(j.toLowerCase()));return F==="all"?u:u&&((Y=l.categoryName)==null?void 0:Y.toLowerCase())===F.toLowerCase()}),le=["all",...new Set(p.map(l=>l.categoryName).filter(Boolean))],re=({item:l})=>e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"flex justify-between items-start mb-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:e.jsx(E,{className:"h-5 w-5 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-gray-900",children:l.customName||l.typeName}),l.manufacturer&&l.model&&e.jsxs("p",{className:"text-sm text-gray-600",children:[l.manufacturer," ",l.model]}),e.jsx("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium mt-1 ${te(l.categoryName)}`,children:l.categoryName}),!l.isActive&&e.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium mt-1 ml-2 bg-red-100 text-red-800",children:"Inactive"})]})]}),e.jsxs("div",{className:"flex gap-1",children:[l.categoryName==="Sprayer"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>se(l),className:"p-1 text-gray-400 hover:text-purple-600",title:"Manage pump assignments",children:e.jsx(E,{className:"h-4 w-4"})}),e.jsx("button",{onClick:()=>ae(l),className:"p-1 text-gray-400 hover:text-green-600",title:"Configure nozzles",children:e.jsx(ie,{className:"h-4 w-4"})})]}),e.jsx("button",{onClick:()=>X(l),className:"p-1 text-gray-400 hover:text-blue-600",title:"Edit equipment",children:e.jsx(ce,{className:"h-4 w-4"})}),e.jsx("button",{onClick:()=>ee(l.id),className:"p-1 text-gray-400 hover:text-red-600",title:"Delete equipment",children:e.jsx(_,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"space-y-2 text-sm text-gray-600",children:ne(l)}),l.notes&&e.jsxs("p",{className:"text-sm text-gray-600 mt-3",children:[e.jsx("strong",{children:"Notes:"})," ",l.notes]}),l.purchaseDate&&e.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Purchased: ",new Date(l.purchaseDate).toLocaleDateString()]})]}),ne=l=>{var u;switch((u=l.categoryName)==null?void 0:u.toLowerCase()){case"mower":return e.jsxs(e.Fragment,{children:[l.mowerStyle&&e.jsxs("p",{children:[e.jsx("strong",{children:"Style:"})," ",l.mowerStyle.replace("_"," ")]}),l.cuttingWidthInches&&e.jsxs("p",{children:[e.jsx("strong",{children:"Cutting Width:"})," ",l.cuttingWidthInches,'"']}),l.engineHp&&e.jsxs("p",{children:[e.jsx("strong",{children:"Engine:"})," ",l.engineHp," HP"]}),l.fuelType&&e.jsxs("p",{children:[e.jsx("strong",{children:"Fuel:"})," ",l.fuelType]})]});case"spreader":return e.jsxs(e.Fragment,{children:[l.spreaderType&&e.jsxs("p",{children:[e.jsx("strong",{children:"Type:"})," ",l.spreaderType.replace("_"," ")]}),l.capacityLbs&&e.jsxs("p",{children:[e.jsx("strong",{children:"Capacity:"})," ",l.capacityLbs," lbs"]}),l.spreadWidth&&e.jsxs("p",{children:[e.jsx("strong",{children:"Spread Width:"})," ",l.spreadWidth," ft"]})]});case"sprayer":return e.jsxs(e.Fragment,{children:[l.sprayerType&&e.jsxs("p",{children:[e.jsx("strong",{children:"Type:"})," ",l.sprayerType.replace("_"," ")]}),l.tankSizeGallons&&e.jsxs("p",{children:[e.jsx("strong",{children:"Tank Size:"})," ",l.tankSizeGallons," gal"]}),l.sprayWidthFeet&&e.jsxs("p",{children:[e.jsx("strong",{children:"Spray Width:"})," ",l.sprayWidthFeet," ft"]}),l.pumpGpm&&e.jsxs("p",{children:[e.jsx("strong",{children:"Pump:"})," ",l.pumpGpm," GPM"]}),l.boomSections&&e.jsxs("p",{children:[e.jsx("strong",{children:"Boom Sections:"})," ",l.boomSections]})]});case"sprinkler":return e.jsxs(e.Fragment,{children:[l.sprinklerMount&&e.jsxs("p",{children:[e.jsx("strong",{children:"Mount:"})," ",l.sprinklerMount.replace("_"," ")]}),l.sprinklerHeadType&&e.jsxs("p",{children:[e.jsx("strong",{children:"Head:"})," ",l.sprinklerHeadType.replace("_"," ")]}),l.sprinklerGpm&&e.jsxs("p",{children:[e.jsx("strong",{children:"GPM:"})," ",l.sprinklerGpm]}),l.sprinklerThrowFeet&&e.jsxs("p",{children:[e.jsx("strong",{children:"Throw:"})," ",l.sprinklerThrowFeet," ft"]}),l.sprinklerDegrees&&e.jsxs("p",{children:[e.jsx("strong",{children:"Degrees:"})," ",l.sprinklerDegrees,"°"]}),l.sprinklerLengthFeet&&e.jsxs("p",{children:[e.jsx("strong",{children:"Length:"})," ",l.sprinklerLengthFeet," ft"]}),l.sprinklerWidthFeet&&e.jsxs("p",{children:[e.jsx("strong",{children:"Width:"})," ",l.sprinklerWidthFeet," ft"]})]});case"pump":return e.jsxs(e.Fragment,{children:[l.pumpType&&e.jsxs("p",{children:[e.jsx("strong",{children:"Type:"})," ",l.pumpType]}),l.maxGpm&&e.jsxs("p",{children:[e.jsx("strong",{children:"Max Flow:"})," ",l.maxGpm," GPM"]}),l.maxPsi&&e.jsxs("p",{children:[e.jsx("strong",{children:"Max Pressure:"})," ",l.maxPsi," PSI"]}),l.powerSource&&e.jsxs("p",{children:[e.jsx("strong",{children:"Power:"})," ",l.powerSource]})]});case"nozzle":return e.jsxs(e.Fragment,{children:[l.orificeSize&&e.jsxs("p",{children:[e.jsx("strong",{children:"Orifice:"})," ",l.orificeSize]}),l.sprayAngle&&e.jsxs("p",{children:[e.jsx("strong",{children:"Spray Angle:"})," ",l.sprayAngle,"°"]}),l.flowRateGpm&&e.jsxs("p",{children:[e.jsx("strong",{children:"Flow Rate:"})," ",l.flowRateGpm," GPM"]}),l.dropletSize&&e.jsxs("p",{children:[e.jsx("strong",{children:"Droplet Size:"})," ",l.dropletSize]}),l.sprayPattern&&e.jsxs("p",{children:[e.jsx("strong",{children:"Pattern:"})," ",l.sprayPattern.replace("_"," ")]}),l.quantityOwned&&e.jsxs("p",{children:[e.jsx("strong",{children:"Quantity:"})," ",l.quantityOwned]})]});default:return e.jsxs(e.Fragment,{children:[l.toolType&&e.jsxs("p",{children:[e.jsx("strong",{children:"Type:"})," ",l.toolType.replace("_"," ")]}),l.workingWidthInches&&e.jsxs("p",{children:[e.jsx("strong",{children:"Working Width:"})," ",l.workingWidthInches,'"']})]})}},te=l=>({Mower:"bg-green-100 text-green-800",Spreader:"bg-orange-100 text-orange-800",Sprayer:"bg-blue-100 text-blue-800",Sprinkler:"bg-cyan-100 text-cyan-800",Nozzle:"bg-teal-100 text-teal-800",Pump:"bg-purple-100 text-purple-800",Aerator:"bg-yellow-100 text-yellow-800",Dethatcher:"bg-red-100 text-red-800",Scarifier:"bg-pink-100 text-pink-800",Trimmer:"bg-indigo-100 text-indigo-800"})[l]||"bg-gray-100 text-gray-800";return s?e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"flex justify-center items-center h-64",children:e.jsx(L,{size:"lg"})})}):e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Equipment"}),e.jsx("p",{className:"text-gray-600",children:"Manage your lawn care equipment inventory"})]}),e.jsxs("button",{onClick:()=>g(!0),className:"btn-primary flex items-center gap-2",children:[e.jsx(V,{className:"h-5 w-5"}),"Add Equipment"]})]}),e.jsx("div",{className:"card mb-6",children:e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx("div",{className:"flex-1 min-w-64",children:e.jsxs("div",{className:"relative",children:[e.jsx(oe,{className:"h-5 w-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),e.jsx("input",{type:"text",className:"input pl-10",placeholder:"Search equipment...",value:j,onChange:Z})]})}),e.jsx("div",{className:"min-w-48",children:e.jsxs("select",{className:"input",value:i,onChange:l=>{N(l.target.value),O()},children:[e.jsx("option",{value:"",children:"All Categories"}),m.map(l=>e.jsx("option",{value:l.id,children:l.name},l.id))]})}),e.jsx("div",{className:"flex items-center",children:e.jsxs("label",{className:"flex items-center",children:[e.jsx("input",{type:"checkbox",checked:x,onChange:l=>{C(l.target.checked),O()},className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),e.jsx("span",{className:"ml-2 text-sm text-gray-700",children:"Show inactive"})]})})]})}),e.jsx("div",{className:"mb-6",children:e.jsx("div",{className:"border-b border-gray-200",children:e.jsx("nav",{className:"-mb-px flex overflow-x-auto",children:le.map(l=>e.jsxs("button",{onClick:()=>A(l),className:`py-2 px-4 border-b-2 font-medium text-sm whitespace-nowrap ${F===l?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[l==="all"?"All Equipment":l,l!=="all"&&e.jsx("span",{className:"ml-2 bg-gray-100 text-gray-600 px-2 py-1 rounded-full text-xs",children:p.filter(u=>u.categoryName===l).length}),l==="all"&&e.jsx("span",{className:"ml-2 bg-gray-100 text-gray-600 px-2 py-1 rounded-full text-xs",children:p.length})]},l))})})}),B.length===0?e.jsxs("div",{className:"card text-center py-12",children:[e.jsx(E,{className:"h-16 w-16 text-gray-300 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Equipment Found"}),e.jsx("p",{className:"text-gray-600 mb-6",children:j||i?"Try adjusting your search or filters":"Start building your equipment inventory"}),!j&&!i&&e.jsx("button",{onClick:()=>g(!0),className:"btn-primary",children:"Add Your First Equipment"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:B.map(l=>e.jsx(re,{item:l},l.id))}),v&&e.jsx(J,{isEdit:!1,equipment:null,categories:m,equipmentTypes:S,onSubmit:K,onCancel:()=>g(!1)}),f&&d&&e.jsx(J,{isEdit:!0,equipment:d,categories:m,equipmentTypes:S,onSubmit:q,onCancel:()=>{t(!1),r(null)}}),W&&I&&e.jsx(de,{sprayer:I,equipment:p.filter(l=>l.categoryName==="Pump"),onClose:()=>{T(!1),G(null),z()}}),M&&R&&e.jsx(pe,{sprayer:R,onClose:()=>{P(!1),H(null),z()}})]})},J=({isEdit:p,equipment:a,categories:m,equipmentTypes:y,onSubmit:S,onCancel:b})=>{const[s,n]=o.useState({equipmentTypeId:(a==null?void 0:a.equipmentTypeId)||"",categoryId:(a==null?void 0:a.categoryId)||"",customName:(a==null?void 0:a.customName)||"",manufacturer:(a==null?void 0:a.manufacturer)||"",model:(a==null?void 0:a.model)||"",notes:(a==null?void 0:a.notes)||"",capacityLbs:(a==null?void 0:a.capacityLbs)||"",spreaderType:(a==null?void 0:a.spreaderType)||"walk_behind",spreadWidth:(a==null?void 0:a.spreadWidth)||"",tankSizeGallons:(a==null?void 0:a.tankSizeGallons)||"",sprayerType:(a==null?void 0:a.sprayerType)||"walk_behind",sprayWidthFeet:(a==null?void 0:a.sprayWidthFeet)||"",pumpGpm:(a==null?void 0:a.pumpGpm)||"",pumpPsi:(a==null?void 0:a.pumpPsi)||"",boomSections:(a==null?void 0:a.boomSections)||"",mowerStyle:(a==null?void 0:a.mowerStyle)||"push",cuttingWidthInches:(a==null?void 0:a.cuttingWidthInches)||"",engineHp:(a==null?void 0:a.engineHp)||"",fuelType:(a==null?void 0:a.fuelType)||"",toolType:(a==null?void 0:a.toolType)||"walk_behind",workingWidthInches:(a==null?void 0:a.workingWidthInches)||"",pumpType:(a==null?void 0:a.pumpType)||"",maxGpm:(a==null?void 0:a.maxGpm)||"",maxPsi:(a==null?void 0:a.maxPsi)||"",powerSource:(a==null?void 0:a.powerSource)||"",orificeSize:(a==null?void 0:a.orificeSize)||"",sprayAngle:(a==null?void 0:a.sprayAngle)||"",flowRateGpm:(a==null?void 0:a.flowRateGpm)||"",dropletSize:(a==null?void 0:a.dropletSize)||"",sprayPattern:(a==null?void 0:a.sprayPattern)||"",pressureRangePsi:(a==null?void 0:a.pressureRangePsi)||"",threadSize:(a==null?void 0:a.threadSize)||"",material:(a==null?void 0:a.material)||"",colorCode:(a==null?void 0:a.colorCode)||"",quantityOwned:(a==null?void 0:a.quantityOwned)||1,sprinklerMount:(a==null?void 0:a.sprinklerMount)||"above_ground",sprinklerHeadType:(a==null?void 0:a.sprinklerHeadType)||"rotor_impact",sprinklerGpm:(a==null?void 0:a.sprinklerGpm)||"",sprinklerThrowFeet:(a==null?void 0:a.sprinklerThrowFeet)||"",sprinklerDegrees:(a==null?void 0:a.sprinklerDegrees)||360,sprinklerLengthFeet:(a==null?void 0:a.sprinklerLengthFeet)||"",sprinklerWidthFeet:(a==null?void 0:a.sprinklerWidthFeet)||"",purchaseDate:(a==null?void 0:a.purchaseDate)||"",purchasePrice:(a==null?void 0:a.purchasePrice)||"",isActive:(a==null?void 0:a.isActive)!==void 0?a.isActive:!0}),v=m.find(t=>t.id===parseInt(s.categoryId)),g=t=>{if(t.preventDefault(),!s.categoryId&&!s.equipmentTypeId){h.error("Please select a category or equipment type");return}if(!s.customName&&!s.equipmentTypeId){h.error("Please enter a name or select an equipment type");return}const d={equipmentTypeId:s.equipmentTypeId?parseInt(s.equipmentTypeId):null,categoryId:s.categoryId?parseInt(s.categoryId):null,customName:s.customName||null,manufacturer:s.manufacturer||null,model:s.model||null,capacityLbs:s.capacityLbs?parseFloat(s.capacityLbs):null,spreaderType:s.spreaderType||null,spreadWidth:s.spreadWidth?parseFloat(s.spreadWidth):null,tankSizeGallons:s.tankSizeGallons?parseFloat(s.tankSizeGallons):null,sprayerType:s.sprayerType||null,sprayWidthFeet:s.sprayWidthFeet?parseFloat(s.sprayWidthFeet):null,pumpGpm:s.pumpGpm?parseFloat(s.pumpGpm):null,pumpPsi:s.pumpPsi?parseFloat(s.pumpPsi):null,boomSections:s.boomSections?parseInt(s.boomSections):null,mowerStyle:s.mowerStyle||null,cuttingWidthInches:s.cuttingWidthInches?parseFloat(s.cuttingWidthInches):null,engineHp:s.engineHp?parseFloat(s.engineHp):null,fuelType:s.fuelType||null,toolType:s.toolType||null,workingWidthInches:s.workingWidthInches?parseFloat(s.workingWidthInches):null,pumpType:s.pumpType||null,maxGpm:s.maxGpm?parseFloat(s.maxGpm):null,maxPsi:s.maxPsi?parseFloat(s.maxPsi):null,powerSource:s.powerSource||null,orificeSize:s.orificeSize||null,sprayAngle:s.sprayAngle?parseInt(s.sprayAngle):null,flowRateGpm:s.flowRateGpm?parseFloat(s.flowRateGpm):null,dropletSize:s.dropletSize||null,sprayPattern:s.sprayPattern||null,pressureRangePsi:s.pressureRangePsi||null,threadSize:s.threadSize||null,material:s.material||null,colorCode:s.colorCode||null,quantityOwned:s.quantityOwned?parseInt(s.quantityOwned):null,sprinklerMount:s.sprinklerMount||null,sprinklerHeadType:s.sprinklerHeadType||null,sprinklerGpm:s.sprinklerGpm?parseFloat(s.sprinklerGpm):null,sprinklerThrowFeet:s.sprinklerThrowFeet?parseFloat(s.sprinklerThrowFeet):null,sprinklerDegrees:s.sprinklerDegrees?parseInt(s.sprinklerDegrees):null,sprinklerLengthFeet:s.sprinklerLengthFeet?parseFloat(s.sprinklerLengthFeet):null,sprinklerWidthFeet:s.sprinklerWidthFeet?parseFloat(s.sprinklerWidthFeet):null,purchaseDate:s.purchaseDate||null,purchasePrice:s.purchasePrice?parseFloat(s.purchasePrice):null,notes:s.notes||null,isActive:s.isActive};S(d)},f=()=>{var d;switch((d=v==null?void 0:v.name)==null?void 0:d.toLowerCase()){case"mower":return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Mower Style *"}),e.jsxs("select",{className:"input",value:s.mowerStyle,onChange:r=>n({...s,mowerStyle:r.target.value}),required:!0,children:[e.jsx("option",{value:"push",children:"Push"}),e.jsx("option",{value:"self_propelled",children:"Self-Propelled"}),e.jsx("option",{value:"zero_turn",children:"Zero Turn"}),e.jsx("option",{value:"lawn_tractor",children:"Lawn Tractor"}),e.jsx("option",{value:"riding",children:"Riding Mower"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Cutting Width (inches)"}),e.jsx("input",{type:"number",step:"0.1",className:"input",value:s.cuttingWidthInches,onChange:r=>n({...s,cuttingWidthInches:r.target.value}),placeholder:"21"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Engine HP"}),e.jsx("input",{type:"number",step:"0.1",className:"input",value:s.engineHp,onChange:r=>n({...s,engineHp:r.target.value}),placeholder:"6.5"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Fuel Type"}),e.jsxs("select",{className:"input",value:s.fuelType,onChange:r=>n({...s,fuelType:r.target.value}),children:[e.jsx("option",{value:"",children:"Select fuel type"}),e.jsx("option",{value:"gasoline",children:"Gasoline"}),e.jsx("option",{value:"diesel",children:"Diesel"}),e.jsx("option",{value:"electric",children:"Electric"}),e.jsx("option",{value:"battery",children:"Battery"}),e.jsx("option",{value:"propane",children:"Propane"})]})]})]})]});case"spreader":return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Spreader Type *"}),e.jsxs("select",{className:"input",value:s.spreaderType,onChange:r=>n({...s,spreaderType:r.target.value}),required:!0,children:[e.jsx("option",{value:"walk_behind",children:"Walk Behind"}),e.jsx("option",{value:"pull_behind",children:"Pull Behind"}),e.jsx("option",{value:"handheld",children:"Handheld"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Capacity (lbs)"}),e.jsx("input",{type:"number",step:"0.1",className:"input",value:s.capacityLbs,onChange:r=>n({...s,capacityLbs:r.target.value}),placeholder:"50"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Spread Width (feet)"}),e.jsx("input",{type:"number",step:"0.1",className:"input",value:s.spreadWidth,onChange:r=>n({...s,spreadWidth:r.target.value}),placeholder:"8"})]})]});case"sprayer":return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Sprayer Type *"}),e.jsxs("select",{className:"input",value:s.sprayerType,onChange:r=>n({...s,sprayerType:r.target.value}),required:!0,children:[e.jsx("option",{value:"walk_behind",children:"Walk Behind"}),e.jsx("option",{value:"tow_behind",children:"Tow Behind"}),e.jsx("option",{value:"mower_mounted",children:"Mower Mounted"}),e.jsx("option",{value:"ride_on",children:"Ride On"}),e.jsx("option",{value:"hand_pump",children:"Hand Pump"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Tank Size (gallons)"}),e.jsx("input",{type:"number",step:"0.1",className:"input",value:s.tankSizeGallons,onChange:r=>n({...s,tankSizeGallons:r.target.value}),placeholder:"25"})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Spray Width (feet)"}),e.jsx("input",{type:"number",step:"0.1",className:"input",value:s.sprayWidthFeet,onChange:r=>n({...s,sprayWidthFeet:r.target.value}),placeholder:"10"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pump GPM"}),e.jsx("input",{type:"number",step:"0.1",className:"input",value:s.pumpGpm,onChange:r=>n({...s,pumpGpm:r.target.value}),placeholder:"2.5"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pump PSI"}),e.jsx("input",{type:"number",className:"input",value:s.pumpPsi,onChange:r=>n({...s,pumpPsi:r.target.value}),placeholder:"60"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Boom Sections"}),e.jsx("input",{type:"number",className:"input",value:s.boomSections,onChange:r=>n({...s,boomSections:r.target.value}),placeholder:"3"})]})]});case"sprinkler":return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Mount *"}),e.jsxs("select",{className:"input",value:s.sprinklerMount,onChange:r=>n({...s,sprinklerMount:r.target.value}),children:[e.jsx("option",{value:"in_ground",children:"InGround"}),e.jsx("option",{value:"above_ground",children:"AboveGround"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Head Type *"}),e.jsxs("select",{className:"input",value:s.sprinklerHeadType,onChange:r=>n({...s,sprinklerHeadType:r.target.value}),children:[e.jsx("option",{value:"rotor_impact",children:"Rotor/Impact"}),e.jsx("option",{value:"oscillating_fan",children:"Oscillating/Fan"}),e.jsx("option",{value:"spray_fixed",children:"Spray (Fixed)"})]})]})]}),(s.sprinklerHeadType==="rotor_impact"||s.sprinklerHeadType==="spray_fixed")&&e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"GPM"}),e.jsx("input",{type:"number",step:"0.1",className:"input",value:s.sprinklerGpm,onChange:r=>n({...s,sprinklerGpm:r.target.value})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Throw (ft)"}),e.jsx("input",{type:"number",step:"0.1",className:"input",value:s.sprinklerThrowFeet,onChange:r=>n({...s,sprinklerThrowFeet:r.target.value})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Degrees"}),e.jsx("input",{type:"number",className:"input",value:s.sprinklerDegrees,onChange:r=>n({...s,sprinklerDegrees:r.target.value})})]})]}),s.sprinklerHeadType==="oscillating_fan"&&e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Length (ft)"}),e.jsx("input",{type:"number",step:"0.1",className:"input",value:s.sprinklerLengthFeet,onChange:r=>n({...s,sprinklerLengthFeet:r.target.value})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Width (ft)"}),e.jsx("input",{type:"number",step:"0.1",className:"input",value:s.sprinklerWidthFeet,onChange:r=>n({...s,sprinklerWidthFeet:r.target.value})})]})]})]});case"pump":return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pump Type"}),e.jsx("input",{type:"text",className:"input",value:s.pumpType,onChange:r=>n({...s,pumpType:r.target.value}),placeholder:"Centrifugal, Diaphragm, etc."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Power Source"}),e.jsxs("select",{className:"input",value:s.powerSource,onChange:r=>n({...s,powerSource:r.target.value}),children:[e.jsx("option",{value:"",children:"Select power source"}),e.jsx("option",{value:"electric",children:"Electric"}),e.jsx("option",{value:"gasoline",children:"Gasoline"}),e.jsx("option",{value:"diesel",children:"Diesel"}),e.jsx("option",{value:"pto",children:"PTO"}),e.jsx("option",{value:"hydraulic",children:"Hydraulic"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Max GPM"}),e.jsx("input",{type:"number",step:"0.1",className:"input",value:s.maxGpm,onChange:r=>n({...s,maxGpm:r.target.value}),placeholder:"10"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Max PSI"}),e.jsx("input",{type:"number",className:"input",value:s.maxPsi,onChange:r=>n({...s,maxPsi:r.target.value}),placeholder:"100"})]})]})]});case"nozzle":return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Orifice Size *"}),e.jsx("input",{type:"text",className:"input",value:s.orificeSize,onChange:r=>n({...s,orificeSize:r.target.value}),placeholder:"02, 03, 04...",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Spray Angle *"}),e.jsx("input",{type:"number",className:"input",value:s.sprayAngle,onChange:r=>n({...s,sprayAngle:r.target.value}),placeholder:"80, 110...",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Flow Rate (GPM) *"}),e.jsx("input",{type:"number",step:"0.001",className:"input",value:s.flowRateGpm,onChange:r=>n({...s,flowRateGpm:r.target.value}),placeholder:"0.20, 0.30...",required:!0})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Droplet Size *"}),e.jsxs("select",{className:"input",value:s.dropletSize,onChange:r=>n({...s,dropletSize:r.target.value}),required:!0,children:[e.jsx("option",{value:"",children:"Select droplet size"}),e.jsx("option",{value:"fine",children:"Fine"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"coarse",children:"Coarse"}),e.jsx("option",{value:"very_coarse",children:"Very Coarse"}),e.jsx("option",{value:"extremely_coarse",children:"Extremely Coarse"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Spray Pattern *"}),e.jsxs("select",{className:"input",value:s.sprayPattern,onChange:r=>n({...s,sprayPattern:r.target.value}),required:!0,children:[e.jsx("option",{value:"",children:"Select spray pattern"}),e.jsx("option",{value:"flat_fan",children:"Flat Fan"}),e.jsx("option",{value:"hollow_cone",children:"Hollow Cone"}),e.jsx("option",{value:"full_cone",children:"Full Cone"}),e.jsx("option",{value:"flooding",children:"Flooding"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pressure Range (PSI)"}),e.jsx("input",{type:"text",className:"input",value:s.pressureRangePsi,onChange:r=>n({...s,pressureRangePsi:r.target.value}),placeholder:"15-60"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Thread Size"}),e.jsx("input",{type:"text",className:"input",value:s.threadSize,onChange:r=>n({...s,threadSize:r.target.value}),placeholder:'1/4", 3/8"...'})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Material"}),e.jsxs("select",{className:"input",value:s.material,onChange:r=>n({...s,material:r.target.value}),children:[e.jsx("option",{value:"",children:"Select material"}),e.jsx("option",{value:"polymer",children:"Polymer"}),e.jsx("option",{value:"stainless_steel",children:"Stainless Steel"}),e.jsx("option",{value:"brass",children:"Brass"}),e.jsx("option",{value:"ceramic",children:"Ceramic"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Color Code"}),e.jsx("input",{type:"text",className:"input",value:s.colorCode,onChange:r=>n({...s,colorCode:r.target.value}),placeholder:"Yellow, Blue, Red..."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Quantity Owned"}),e.jsx("input",{type:"number",min:"1",className:"input",value:s.quantityOwned,onChange:r=>n({...s,quantityOwned:r.target.value}),placeholder:"1"})]})]})]});default:return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Tool Type"}),e.jsxs("select",{className:"input",value:s.toolType,onChange:r=>n({...s,toolType:r.target.value}),children:[e.jsx("option",{value:"walk_behind",children:"Walk Behind"}),e.jsx("option",{value:"tow_behind",children:"Tow Behind"}),e.jsx("option",{value:"handheld",children:"Handheld"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Working Width (inches)"}),e.jsx("input",{type:"number",step:"0.1",className:"input",value:s.workingWidthInches,onChange:r=>n({...s,workingWidthInches:r.target.value}),placeholder:"18"})]})]})})}};return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:p?"Edit Equipment":"Add New Equipment"}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Equipment Type (Optional)"}),e.jsxs("select",{className:"input",value:s.equipmentTypeId,onChange:t=>{const d=y.find(r=>r.id===parseInt(t.target.value));n({...s,equipmentTypeId:t.target.value,categoryId:(d==null?void 0:d.categoryId)||s.categoryId})},children:[e.jsx("option",{value:"",children:"Select from database..."}),y.map(t=>e.jsxs("option",{value:t.id,children:[t.name," ",t.manufacturer&&`- ${t.manufacturer}`]},t.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Category *"}),e.jsxs("select",{className:"input",value:s.categoryId,onChange:t=>n({...s,categoryId:t.target.value}),required:!s.equipmentTypeId,children:[e.jsx("option",{value:"",children:"Select category..."}),m.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Equipment Name *"}),e.jsx("input",{type:"text",className:"input",value:s.customName,onChange:t=>n({...s,customName:t.target.value}),placeholder:"My Lawn Mower, Office Spreader, etc.",required:!s.equipmentTypeId})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Manufacturer"}),e.jsx("input",{type:"text",className:"input",value:s.manufacturer,onChange:t=>n({...s,manufacturer:t.target.value}),placeholder:"Toro, John Deere, etc."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Model"}),e.jsx("input",{type:"text",className:"input",value:s.model,onChange:t=>n({...s,model:t.target.value}),placeholder:"Model number"})]})]}),s.categoryId&&f(),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Purchase Date"}),e.jsx("input",{type:"date",className:"input",value:s.purchaseDate,onChange:t=>n({...s,purchaseDate:t.target.value})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Purchase Price"}),e.jsx("input",{type:"number",step:"0.01",className:"input",value:s.purchasePrice,onChange:t=>n({...s,purchasePrice:t.target.value}),placeholder:"0.00"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Notes"}),e.jsx("textarea",{className:"input",rows:"3",value:s.notes,onChange:t=>n({...s,notes:t.target.value}),placeholder:"Maintenance notes, special instructions, etc."})]}),p&&e.jsx("div",{className:"flex items-center",children:e.jsxs("label",{className:"flex items-center",children:[e.jsx("input",{type:"checkbox",checked:s.isActive,onChange:t=>n({...s,isActive:t.target.checked}),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),e.jsx("span",{className:"ml-2 text-sm text-gray-700",children:"Equipment is active"})]})}),e.jsxs("div",{className:"flex gap-3 pt-4",children:[e.jsx("button",{type:"submit",className:"btn-primary flex-1",children:p?"Update Equipment":"Create Equipment"}),e.jsx("button",{type:"button",onClick:b,className:"btn-secondary flex-1",children:"Cancel"})]})]})]})})},de=({sprayer:p,equipment:a,onClose:m})=>{const[y,S]=o.useState([]),[b,s]=o.useState([]),[n,v]=o.useState(!0),[g,f]=o.useState("");o.useEffect(()=>{t()},[p.id]);const t=async()=>{try{v(!0);const[i,N]=await Promise.all([w.getPumpAssignments(p.id),Promise.resolve({data:{data:{pumps:a}}})]);S(i.data.data.assignments||[]),s(N.data.data.pumps||[])}catch(i){console.error("Failed to fetch pump assignments:",i),h.error("Failed to load pump assignments")}finally{v(!1)}},d=async()=>{if(g)try{await w.assignPump(p.id,g),h.success("Pump assigned successfully"),f(""),t()}catch(i){console.error("Failed to assign pump:",i),h.error("Failed to assign pump")}},r=async i=>{try{await w.unassignPump(i),h.success("Pump unassigned successfully"),t()}catch(N){console.error("Failed to unassign pump:",N),h.error("Failed to unassign pump")}};return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs("h3",{className:"text-lg font-semibold mb-4",children:["Pump Assignments - ",p.customName||p.typeName]}),n?e.jsx(L,{}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6 p-4 bg-gray-50 rounded-lg",children:[e.jsx("h4",{className:"font-medium mb-3",children:"Assign New Pump"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("select",{className:"input flex-1",value:g,onChange:i=>f(i.target.value),children:[e.jsx("option",{value:"",children:"Select a pump..."}),b.map(i=>e.jsxs("option",{value:i.id,children:[i.customName||i.typeName,i.manufacturer&&` - ${i.manufacturer}`,i.maxGpm&&` (${i.maxGpm} GPM)`]},i.id))]}),e.jsx("button",{onClick:d,disabled:!g,className:"btn-primary",children:"Assign"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"font-medium",children:"Current Pump Assignments"}),y.length===0?e.jsx("p",{className:"text-gray-500",children:"No pumps assigned to this sprayer"}):y.map(i=>{var N,j,c,x;return e.jsxs("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:((N=i.pump)==null?void 0:N.customName)||((j=i.pump)==null?void 0:j.typeName)}),((c=i.pump)==null?void 0:c.manufacturer)&&e.jsxs("div",{className:"text-sm text-gray-600",children:[i.pump.manufacturer," ",i.pump.model]}),((x=i.pump)==null?void 0:x.maxGpm)&&e.jsxs("div",{className:"text-sm text-gray-600",children:["Max Flow: ",i.pump.maxGpm," GPM"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:["Assigned: ",new Date(i.assignedDate).toLocaleDateString()]})]}),e.jsx("button",{onClick:()=>r(i.id),className:"text-red-600 hover:text-red-800",children:e.jsx(_,{className:"h-5 w-5"})})]},i.id)})]})]}),e.jsx("div",{className:"flex gap-3 pt-6 mt-6 border-t",children:e.jsx("button",{onClick:m,className:"btn-secondary flex-1",children:"Close"})})]})})},pe=({sprayer:p,onClose:a})=>{const[m,y]=o.useState([]),[S,b]=o.useState([]),[s,n]=o.useState([]),[v,g]=o.useState(!0),[f,t]=o.useState(!1),[d,r]=o.useState({userNozzleId:"",position:"",quantityAssigned:1});o.useEffect(()=>{i()},[p.id]);const i=async()=>{try{g(!0);const[c,x,C]=await Promise.all([w.getNozzleConfigurations(p.id),w.getNozzleTypes(),w.getUserNozzles()]);y(c.data.data.configurations||[]),b(x.data.data.nozzleTypes||[]),n(C.data.data.userNozzles||[])}catch(c){console.error("Failed to fetch nozzle configurations:",c),h.error("Failed to load nozzle configurations")}finally{g(!1)}},N=async()=>{try{await w.addNozzleConfiguration(p.id,d),h.success("Nozzle configuration added"),t(!1),r({userNozzleId:"",position:"",quantityAssigned:1}),i()}catch(c){console.error("Failed to add configuration:",c),h.error("Failed to add configuration")}},j=async c=>{try{await w.removeNozzleConfiguration(c),h.success("Nozzle configuration removed"),i()}catch(x){console.error("Failed to remove configuration:",x),h.error("Failed to remove configuration")}};return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsxs("h3",{className:"text-lg font-semibold mb-4",children:["Nozzle Configuration - ",p.customName||p.typeName]}),v?e.jsx(L,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-6",children:e.jsxs("button",{onClick:()=>t(!0),className:"btn-primary flex items-center gap-2",children:[e.jsx(V,{className:"h-5 w-5"}),"Add Nozzle Configuration"]})}),f&&e.jsxs("div",{className:"mb-6 p-4 bg-gray-50 rounded-lg",children:[e.jsx("h4",{className:"font-medium mb-3",children:"Add Nozzle Configuration"}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("select",{className:"input",value:d.userNozzleId,onChange:c=>r({...d,userNozzleId:c.target.value}),children:[e.jsx("option",{value:"",children:"Select nozzle..."}),s.map(c=>{var x;return e.jsxs("option",{value:c.id,children:[(x=c.nozzleType)==null?void 0:x.name," (",c.quantity," available)"]},c.id)})]}),e.jsx("input",{type:"text",className:"input",placeholder:"Position (e.g., left, right, boom_1)",value:d.position,onChange:c=>r({...d,position:c.target.value})}),e.jsx("input",{type:"number",className:"input",placeholder:"Quantity",min:"1",value:d.quantityAssigned,onChange:c=>r({...d,quantityAssigned:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"flex gap-3 mt-3",children:[e.jsx("button",{onClick:N,className:"btn-primary",children:"Add Configuration"}),e.jsx("button",{onClick:()=>t(!1),className:"btn-secondary",children:"Cancel"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"font-medium",children:"Current Nozzle Configurations"}),m.length===0?e.jsx("p",{className:"text-gray-500",children:"No nozzles configured for this sprayer"}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:m.map(c=>{var x,C,F,A,W,T,M,P,I,G;return e.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg",children:[e.jsxs("div",{className:"flex justify-between items-start mb-2",children:[e.jsx("div",{className:"font-medium",children:(C=(x=c.userNozzle)==null?void 0:x.nozzleType)==null?void 0:C.name}),e.jsx("button",{onClick:()=>j(c.id),className:"text-red-600 hover:text-red-800",children:e.jsx(_,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"text-sm text-gray-600 space-y-1",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Position:"})," ",c.position]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Quantity:"})," ",c.quantityAssigned]}),((A=(F=c.userNozzle)==null?void 0:F.nozzleType)==null?void 0:A.manufacturer)&&e.jsxs("div",{children:[e.jsx("strong",{children:"Manufacturer:"})," ",c.userNozzle.nozzleType.manufacturer]}),((T=(W=c.userNozzle)==null?void 0:W.nozzleType)==null?void 0:T.orificeSize)&&e.jsxs("div",{children:[e.jsx("strong",{children:"Orifice:"})," ",c.userNozzle.nozzleType.orificeSize]}),((P=(M=c.userNozzle)==null?void 0:M.nozzleType)==null?void 0:P.sprayAngle)&&e.jsxs("div",{children:[e.jsx("strong",{children:"Spray Angle:"})," ",c.userNozzle.nozzleType.sprayAngle,"°"]}),((G=(I=c.userNozzle)==null?void 0:I.nozzleType)==null?void 0:G.dropletSize)&&e.jsxs("div",{children:[e.jsx("strong",{children:"Droplet Size:"})," ",c.userNozzle.nozzleType.dropletSize]}),e.jsxs("div",{className:"text-xs text-gray-500",children:["Assigned: ",new Date(c.assignedDate).toLocaleDateString()]})]})]},c.id)})})]})]}),e.jsx("div",{className:"flex gap-3 pt-6 mt-6 border-t",children:e.jsx("button",{onClick:a,className:"btn-secondary flex-1",children:"Close"})})]})})};export{xe as default};