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

2 lines
20 KiB
JavaScript

import{r as i,i as C,m as Ae,z as le,j as e,L as Fe,H as Me,o as P,d as Te,I as _,b as ie,c as Ce,v as oe,G as Pe,J as _e}from"./index-9FS9bw8D.js";const $e=()=>{const[N,ce]=i.useState([]),[S,de]=i.useState([]),[L,R]=i.useState([]),[me,q]=i.useState(!0),[ue,H]=i.useState(!1),[$,I]=i.useState(null),[V,E]=i.useState(null),[xe,Le]=i.useState(null),[h,B]=i.useState("all"),[f,z]=i.useState(""),[j,G]=i.useState(""),[O,W]=i.useState("date"),[b,J]=i.useState("all"),[v,U]=i.useState("all"),[g,y]=i.useState([]),[u,K]=i.useState("all"),[A,ge]=i.useState(!1),[D,F]=i.useState(!1),pe=(t,s,a,n)=>{const l=p=>p*Math.PI/180,o=l(a-t),d=l(n-s),x=Math.sin(o/2)**2+Math.cos(l(t))*Math.cos(l(a))*Math.sin(d/2)**2;return 2*6371e3*Math.atan2(Math.sqrt(x),Math.sqrt(1-x))},he=(t=[])=>{if(!Array.isArray(t)||t.length<2)return 0;let s=0;for(let a=1;a<t.length;a++){const n=t[a-1],r=t[a];s+=pe(n.lat,n.lng,r.lat,r.lng)}return s*3.28084},fe=(t,s)=>{var p,m;if(!((p=s==null?void 0:s.gpsTrack)!=null&&p.points)||s.gpsTrack.points.length<2)return 0;const a=typeof s.gpsTrack.totalDistance=="number"?s.gpsTrack.totalDistance:0,n=a>0?a*3.28084:he(s.gpsTrack.points),r=t.totalSectionArea||0;if(n===0||r===0)return 0;let l=4;const o=((m=t.equipmentName)==null?void 0:m.toLowerCase())||"";o.includes("spreader")?l=12:o.includes("sprayer")?l=20:o.includes("mower")&&(l=6);const d=n*l,x=Math.min(d/r*100,100);return Math.round(x)};i.useEffect(()=>{Q()},[]),i.useEffect(()=>{const t=s=>{D&&!s.target.closest(".relative")&&F(!1)};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[D]);const Q=async()=>{var t,s,a;try{q(!0);const[n,r]=await Promise.all([C.getPlans({status:"completed"}),C.getPlans({status:"archived"})]),l=n.data.data.plans||[],o=r.data.data.plans||[],d=[...l,...o],p=(await C.getLogs()).data.data.logs||[];ce(d),de(p);try{const m=await Ae.getLogs();R(((s=(t=m.data)==null?void 0:t.data)==null?void 0:s.logs)||[])}catch(m){console.warn("Failed to load mowing logs",((a=m==null?void 0:m.response)==null?void 0:a.data)||m.message),R([])}}catch(n){console.error("Failed to fetch history data:",n),le.error("Failed to load application history")}finally{q(!1)}},je=async t=>{try{I(t),H(!0)}catch(s){console.error("Failed to load application details:",s),le.error("Failed to load application details")}},M=t=>!t.productDetails||t.productDetails.length===0?null:t.productDetails[0].type,be=N.filter(t=>{if(h!=="all"){const s=new Date(t.plannedDate),a=new Date;switch(h){case"today":if(s.toDateString()!==a.toDateString())return!1;break;case"week":const n=new Date(a.getTime()-7*24*60*60*1e3);if(s<n)return!1;break;case"month":const r=new Date(a.getTime()-30*24*60*60*1e3);if(s<r)return!1;break;case"custom":if(f){const l=new Date(f);if(l.setHours(0,0,0,0),s<l)return!1}if(j){const l=new Date(j);if(l.setHours(23,59,59,999),s>l)return!1}break}}return!(b!=="all"&&t.status!==b||v!=="all"&&t.propertyName!==v||u!=="all"&&M(t)!==u)}),ve=[...new Set([...N.map(t=>t.propertyName),...L.map(t=>t.property_name)])].filter(Boolean),k=[...new Set(be.flatMap(t=>t.productDetails?t.productDetails.map(s=>s.name):[]))].filter(Boolean).sort(),X=N.filter(t=>{if(h!=="all"){const s=new Date(t.plannedDate),a=new Date;switch(h){case"today":if(s.toDateString()!==a.toDateString())return!1;break;case"week":const n=new Date(a.getTime()-7*24*60*60*1e3);if(s<n)return!1;break;case"month":const r=new Date(a.getTime()-30*24*60*60*1e3);if(s<r)return!1;break;case"custom":if(f){const l=new Date(f);if(l.setHours(0,0,0,0),s<l)return!1}if(j){const l=new Date(j);if(l.setHours(23,59,59,999),s>l)return!1}break}}return!(b!=="all"&&t.status!==b||v!=="all"&&t.propertyName!==v||g.length>0&&(!t.productDetails||!t.productDetails.some(s=>g.includes(s.name)))||u==="mowing"||u!=="all"&&u!=="mowing"&&M(t)!==u)});[...X].sort((t,s)=>{var a,n;switch(O){case"date":return new Date(s.plannedDate)-new Date(t.plannedDate);case"area":return(s.totalSectionArea||0)-(t.totalSectionArea||0);case"duration":const r=S.find(o=>o.planId===t.id),l=S.find(o=>o.planId===s.id);return(((a=l==null?void 0:l.gpsTrack)==null?void 0:a.duration)||0)-(((n=r==null?void 0:r.gpsTrack)==null?void 0:n.duration)||0);default:return 0}});const we=N.length,Ne=N.reduce((t,s)=>t+(s.totalSectionArea||0),0),ye=S.reduce((t,s)=>{var a;return t+(((a=s.gpsTrack)==null?void 0:a.duration)||0)},0),De=[...(L||[]).filter(t=>{if(h!=="all"){const s=t.session_date||t.created_at,a=s?new Date(s):null;if(!a)return!1;const n=new Date;switch(h){case"today":if(a.toDateString()!==n.toDateString())return!1;break;case"week":{const r=new Date(n.getTime()-6048e5);if(a<r)return!1;break}case"month":{const r=new Date(n.getTime()-2592e6);if(a<r)return!1;break}case"custom":if(f){const r=new Date(f);if(r.setHours(0,0,0,0),a<r)return!1}if(j){const r=new Date(j);if(r.setHours(23,59,59,999),a>r)return!1}break}}return!(v!=="all"&&(t.property_name||"")!==v)})].sort((t,s)=>{const a=t.session_date||t.created_at||0,n=s.session_date||s.created_at||0;return new Date(n)-new Date(a)}),Y=(()=>{const t=[...X].map(n=>{const r=S.find(d=>d.planId===n.id),l=(r==null?void 0:r.applicationDate)||n.plannedDate||n.updatedAt||n.createdAt;return{kind:"application",date:l?new Date(l):new Date(0),application:n,log:r}}),s=[...De].map(n=>{const r=n.session_date||n.created_at;return{kind:"mowing",date:r?new Date(r):new Date(0),log:n}});let a=[...t,...s];return b==="archived"?a=a.filter(n=>n.kind==="application"&&n.application.status==="archived"):b==="completed"&&(a=a.filter(n=>n.kind==="application"&&n.application.status==="completed"||n.kind==="mowing")),u==="granular"||u==="liquid"?a=a.filter(n=>n.kind==="application"&&M(n.application)===u):u==="mowing"&&(a=a.filter(n=>n.kind==="mowing")),a.sort((n,r)=>r.date-n.date),a})(),ke=t=>{var d,x;const a=(t.total_distance_meters||((d=t.gpsTrack)==null?void 0:d.totalDistance)||((x=t.gps_track)==null?void 0:x.totalDistance)||0||0)*3.28084,n=Number(t.total_area||0),r=parseFloat(t.cutting_width_inches||0),l=isNaN(r)?0:r/12;if(a===0||n===0||l===0)return 0;const o=a*l;return Math.min(100,Math.round(o/n*100))};return me?e.jsx("div",{className:"p-6",children:e.jsx(Fe,{})}):e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"History"}),e.jsx("button",{onClick:Q,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:"Refresh"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[e.jsx("div",{className:"bg-blue-50 p-4 rounded-lg",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(Me,{className:"h-8 w-8 text-blue-600"}),e.jsxs("div",{className:"ml-3",children:[e.jsx("p",{className:"text-sm text-blue-600 font-medium",children:"Total Applications"}),e.jsx("p",{className:"text-2xl font-bold text-blue-900",children:we})]})]})}),e.jsx("div",{className:"bg-green-50 p-4 rounded-lg",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(P,{className:"h-8 w-8 text-green-600"}),e.jsxs("div",{className:"ml-3",children:[e.jsx("p",{className:"text-sm text-green-600 font-medium",children:"Total Area Treated"}),e.jsxs("p",{className:"text-2xl font-bold text-green-900",children:[Math.round(Ne/1e3),"k sq ft"]})]})]})}),e.jsx("div",{className:"bg-purple-50 p-4 rounded-lg",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(Te,{className:"h-8 w-8 text-purple-600"}),e.jsxs("div",{className:"ml-3",children:[e.jsx("p",{className:"text-sm text-purple-600 font-medium",children:"Total Time"}),e.jsxs("p",{className:"text-2xl font-bold text-purple-900",children:[Math.round(ye/3600),"h"]})]})]})})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow mb-6",children:[e.jsx("div",{className:"p-4 border-b border-gray-200",children:e.jsxs("button",{onClick:()=>ge(!A),className:"flex items-center justify-between w-full text-left",children:[e.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Filters & Sorting"}),e.jsx("svg",{className:`h-5 w-5 transform transition-transform ${A?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),A&&e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Time Period"}),e.jsxs("select",{value:h,onChange:t=>B(t.target.value),className:"w-full border border-gray-300 rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[e.jsx("option",{value:"all",children:"All Time"}),e.jsx("option",{value:"today",children:"Today"}),e.jsx("option",{value:"week",children:"Last Week"}),e.jsx("option",{value:"month",children:"Last Month"}),e.jsx("option",{value:"custom",children:"Custom Range"})]}),h==="custom"&&e.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:"From"}),e.jsx("input",{type:"date",value:f,onChange:t=>z(t.target.value),className:"w-full border border-gray-300 rounded px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:"To"}),e.jsx("input",{type:"date",value:j,onChange:t=>G(t.target.value),className:"w-full border border-gray-300 rounded px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Status"}),e.jsxs("select",{value:b,onChange:t=>J(t.target.value),className:"w-full border border-gray-300 rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[e.jsx("option",{value:"all",children:"All Status"}),e.jsx("option",{value:"completed",children:"Completed"}),e.jsx("option",{value:"archived",children:"Archived"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Property"}),e.jsxs("select",{value:v,onChange:t=>U(t.target.value),className:"w-full border border-gray-300 rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[e.jsx("option",{value:"all",children:"All Properties"}),ve.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Products"}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>F(!D),className:"w-full border border-gray-300 rounded px-3 py-2 text-sm text-left focus:outline-none focus:ring-2 focus:ring-blue-500 flex items-center justify-between",children:[e.jsx("span",{children:g.length===0?"All Products":`${g.length} selected`}),e.jsx("svg",{className:`h-4 w-4 transform transition-transform ${D?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),D&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg max-h-60 overflow-auto",children:k.length===0?e.jsx("div",{className:"px-3 py-2 text-sm text-gray-500",children:"No products available"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-2 border-b",children:e.jsx("button",{onClick:()=>{g.length===k.length?y([]):y([...k])},className:"text-xs text-blue-600 hover:text-blue-800",children:g.length===k.length?"Deselect All":"Select All"})}),k.map(t=>e.jsxs("label",{className:"flex items-center px-3 py-2 hover:bg-gray-50 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:g.includes(t),onChange:s=>{s.target.checked?y([...g,t]):y(g.filter(a=>a!==t))},className:"mr-2"}),e.jsx("span",{className:"text-sm",children:t})]},t))]})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Application Type"}),e.jsxs("select",{value:u,onChange:t=>K(t.target.value),className:"w-full border border-gray-300 rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"granular",children:"Granular"}),e.jsx("option",{value:"liquid",children:"Liquid"}),e.jsx("option",{value:"mowing",children:"Mowing"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Sort By"}),e.jsxs("select",{value:O,onChange:t=>W(t.target.value),className:"w-full border border-gray-300 rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[e.jsx("option",{value:"date",children:"Date"}),e.jsx("option",{value:"area",children:"Area Size"}),e.jsx("option",{value:"duration",children:"Duration"})]})]})]}),e.jsx("div",{className:"mt-4 pt-4 border-t border-gray-200",children:e.jsx("button",{onClick:()=>{B("all"),z(""),G(""),J("all"),U("all"),y([]),K("all"),W("date"),F(!1)},className:"px-4 py-2 text-sm text-gray-600 hover:text-gray-800 border border-gray-300 rounded hover:bg-gray-50",children:"Clear All Filters"})})]})]}),Y.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(_,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No history items"}),e.jsx("p",{className:"text-gray-500",children:"Try adjusting your filters or date range."})]}):e.jsx("div",{className:"grid gap-4",children:Y.map(t=>{var r,l,o,d,x,p,m,Z,ee,te,se,ae,ne,re;if(t.kind==="application"){const c=t.application,w=t.log;return e.jsx("div",{className:"bg-white p-6 rounded-lg shadow hover:shadow-lg transition-shadow",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900",children:[c.propertyName," - ",c.sectionNames]}),e.jsx("span",{className:"px-2 py-0.5 text-xs rounded-full bg-indigo-100 text-indigo-800",children:"Application"})]}),e.jsx("span",{className:`px-3 py-1 text-sm font-medium rounded-full ${c.status==="archived"?"bg-gray-100 text-gray-800":"bg-green-100 text-green-800"}`,children:c.status==="archived"?"Archived":"Completed"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[e.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[e.jsx(_,{className:"h-4 w-4 mr-2"}),new Date(t.date).toLocaleString()]}),e.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[e.jsx(P,{className:"h-4 w-4 mr-2"}),c.propertyName]}),e.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[e.jsx(ie,{className:"h-4 w-4 mr-2"}),c.equipmentName]})]}),(w==null?void 0:w.gpsTrack)&&e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 mb-4",children:[e.jsxs("div",{className:"bg-blue-50 p-2 rounded text-center",children:[e.jsx("div",{className:"text-xs text-blue-600 font-medium",children:"Duration"}),e.jsxs("div",{className:"text-sm font-bold text-blue-900",children:[Math.round((((r=w.gpsTrack)==null?void 0:r.duration)||0)/60)," min"]})]}),e.jsxs("div",{className:"bg-green-50 p-2 rounded text-center",children:[e.jsx("div",{className:"text-xs text-green-600 font-medium",children:"GPS Points"}),e.jsx("div",{className:"text-sm font-bold text-green-900",children:((o=(l=w.gpsTrack)==null?void 0:l.points)==null?void 0:o.length)||0})]}),e.jsxs("div",{className:"bg-purple-50 p-2 rounded text-center",children:[e.jsx("div",{className:"text-xs text-purple-600 font-medium",children:"Distance"}),e.jsxs("div",{className:"text-sm font-bold text-purple-900",children:[Math.round(((d=w.gpsTrack)==null?void 0:d.totalDistance)||0)," ft"]})]}),e.jsxs("div",{className:"bg-orange-50 p-2 rounded text-center",children:[e.jsx("div",{className:"text-xs text-orange-600 font-medium",children:"Coverage"}),e.jsxs("div",{className:"text-sm font-bold text-orange-900",children:[fe(c,w),"%"]})]})]}),c.productDetails&&c.productDetails.length>0&&e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center text-sm text-gray-600 mb-2",children:[e.jsx(Ce,{className:"h-4 w-4 mr-2"}),"Products Applied:"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:c.productDetails.map((T,Se)=>e.jsxs("span",{className:"px-2 py-1 bg-gray-100 text-gray-700 rounded text-xs",children:[T.name," (",T.rateAmount," ",T.rateUnit,")"]},Se))})]}),c.notes&&e.jsxs("p",{className:"text-sm text-gray-600 mb-4",children:[e.jsx("strong",{children:"Notes:"})," ",c.notes]})]}),e.jsx("div",{className:"ml-4",children:e.jsx("button",{onClick:()=>je(c),className:"p-2 text-indigo-600 hover:text-indigo-800 hover:bg-indigo-50 rounded",title:"View details",children:e.jsx(oe,{className:"h-5 w-5"})})})]})},`app-${c.id}`)}const s=t.log,a=Math.round((s.duration_seconds||s.durationSeconds||((x=s.gpsTrack)==null?void 0:x.duration)||((p=s.gps_track)==null?void 0:p.duration)||0)/60);(Z=(m=s.average_speed_mph||s.averageSpeed||0).toFixed)!=null&&Z.call(m,1)||Number(s.averageSpeed||0).toFixed(1);const n=Math.round((s.total_distance_meters||((ee=s.gpsTrack)==null?void 0:ee.totalDistance)||((te=s.gps_track)==null?void 0:te.totalDistance)||0)*3.28084||0);return e.jsx("div",{className:"bg-white p-6 rounded-lg shadow hover:shadow-lg transition-shadow",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900",children:[s.property_name||"Property"," - ",s.section_names||"Areas"]}),e.jsx("span",{className:"px-2 py-0.5 text-xs rounded-full bg-green-100 text-green-800",children:"Mowing"})]}),e.jsx("span",{className:"px-3 py-1 text-sm font-medium rounded-full bg-green-100 text-green-800",children:"Completed"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[e.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[e.jsx(_,{className:"h-4 w-4 mr-2"}),new Date(t.date).toLocaleString()]}),e.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[e.jsx(P,{className:"h-4 w-4 mr-2"}),s.property_name]}),e.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[e.jsx(ie,{className:"h-4 w-4 mr-2"}),s.equipment_name||"Mower"]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 mb-4",children:[e.jsxs("div",{className:"bg-blue-50 p-2 rounded text-center",children:[e.jsx("div",{className:"text-xs text-blue-600 font-medium",children:"Duration"}),e.jsxs("div",{className:"text-sm font-bold text-blue-900",children:[a," min"]})]}),e.jsxs("div",{className:"bg-green-50 p-2 rounded text-center",children:[e.jsx("div",{className:"text-xs text-green-600 font-medium",children:"GPS Points"}),e.jsx("div",{className:"text-sm font-bold text-green-900",children:((ae=(se=s.gpsTrack)==null?void 0:se.points)==null?void 0:ae.length)||((re=(ne=s.gps_track)==null?void 0:ne.points)==null?void 0:re.length)||0})]}),e.jsxs("div",{className:"bg-purple-50 p-2 rounded text-center",children:[e.jsx("div",{className:"text-xs text-purple-600 font-medium",children:"Distance"}),e.jsxs("div",{className:"text-sm font-bold text-purple-900",children:[n," ft"]})]}),e.jsxs("div",{className:"bg-orange-50 p-2 rounded text-center",children:[e.jsx("div",{className:"text-xs text-orange-600 font-medium",children:"Coverage"}),e.jsxs("div",{className:"text-sm font-bold text-orange-900",children:[ke(s),"%"]})]})]})]}),e.jsx("div",{className:"ml-4",children:e.jsx("button",{onClick:()=>E(s),className:"p-2 text-indigo-600 hover:text-indigo-800 hover:bg-indigo-50 rounded",title:"View mowing session",children:e.jsx(oe,{className:"h-5 w-5"})})})]})},`mow-${s.id}`)})}),ue&&$&&e.jsx(Pe,{application:$,propertyDetails:xe,onClose:()=>{H(!1),I(null)}}),V&&e.jsx(_e,{session:V,onClose:()=>E(null)})]})};export{$e as default};