1import{c as De,j as e,X,B as I,d as We,r as o,p as x,b as u,C as E,t as h}from"./index-Bk5BuC5a.js";import{U as Ce}from"./UserLayout-DBjtJB7m.js";import{F as Te}from"./folder-kanban-D08io-hN.js";import{I as Me}from"./image-DFji1miO.js";import{D as Ee}from"./dollar-sign-CLd-k4Sz.js";import{B as Z}from"./briefcase-NfCTeB5k.js";import{M as Ie}from"./message-square-Dxgg0Fd2.js";import{C as ee}from"./clock-DgFv4Hd4.js";import{C as $e}from"./chevron-up-BYQS6PeQ.js";import{C as Ae}from"./chevron-down-Dcnl6xez.js";import{P as Fe}from"./pen-KczXkx5H.js";import"./user-CvvRMmqW.js";import"./receipt-Buf4yFKk.js";import"./log-out-B4zgTiuH.js";import"./menu-9a0R2qVB.js";import"./bell-mZ650MBT.js";/** 2 * @license lucide-react v0.487.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Oe=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],se=De("history",Oe);function Le({isOpen:$,workDate:v,description:y,hoursWorked:p,notes:A,onClose:z,onChange:b,onSubmit:j,isSubmitting:w}){return $?e.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-[60] p-4",children:e.jsxs("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg max-w-2xl w-full",children:[e.jsxs("div",{className:"p-6 border-b border-zinc-800 flex items-center justify-between",children:[e.jsx("h2",{className:"text-xl font-semibold text-white",children:"Edit Work Submission"}),e.jsx("button",{onClick:z,className:"p-2 hover:bg-zinc-800 rounded",children:e.jsx(X,{className:"w-5 h-5 text-zinc-400"})})]}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-zinc-300 mb-2",children:["Date ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"date",name:"workDate",value:v,onChange:b,max:new Date().toISOString().split("T")[0],className:"w-full px-4 py-2 bg-zinc-800 border border-zinc-700 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-blue-500"}),e.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Cannot set future dates"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-zinc-300 mb-2",children:["Description ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("textarea",{name:"description",value:y,onChange:b,placeholder:"Describe the work done...",rows:4,className:"w-full px-4 py-2 bg-zinc-800 border border-zinc-700 rounded-lg text-white placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-2",children:"Hours Worked"}),e.jsx("input",{type:"number",name:"hoursWorked",step:"0.5",min:"0",value:p,onChange:b,placeholder:"e.g., 8 or 4.5",className:"w-full px-4 py-2 bg-zinc-800 border border-zinc-700 rounded-lg text-white placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-2",children:"Additional Notes"}),e.jsx("textarea",{name:"notes",value:A,onChange:b,placeholder:"Any additional comments...",rows:3,className:"w-full px-4 py-2 bg-zinc-800 border border-zinc-700 rounded-lg text-white placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]}),e.jsxs("div",{className:"p-6 border-t border-zinc-800 flex justify-end gap-3",children:[e.jsx(I,{onClick:z,variant:"outline",className:"border-zinc-700 text-black hover:bg-zinc-100 cursor-pointer",disabled:w,children:"Cancel"}),e.jsx(I,{onClick:j,className:"bg-blue-600 hover:bg-blue-700 text-white cursor-pointer",disabled:w||!y.trim(),children:w?"Updating...":"Update Submission"})]})]})}):null}function ss(){const $=We(),[v,y]=o.useState(null),[p,A]=o.useState([]),[z,b]=o.useState(!0),[j,w]=o.useState({}),[te,ne]=o.useState([]),[re,ae]=o.useState([]),[ie,oe]=o.useState(0),[ce,le]=o.useState(0),[de,_]=o.useState(!1),[me,P]=o.useState(!1),[xe,J]=o.useState(!1),[ue,S]=o.useState(!1),[c,f]=o.useState(null),[N,g]=o.useState([]),[d,D]=o.use
6State({workDate:new Date().toISOString().split("T")[0],description:"",hoursWorked:"",notes:""}),[F,K]=o.useState(!1),[he,q]=o.useState(!1),[k,O]=o.useState(""),[R,be]=o.useState(new Set),[W,L]=o.useState(null),[Y,U]=o.useState(!1),[m,B]=o.useState({workDate:"",description:"",hoursWorked:"",notes:""}),[pe,V]=o.useState(!1);o.useEffect(()=>{fe()},[]),o.useEffect(()=>{const s=setInterval(()=>{const t={};p.forEach(n=>{const i=new Date(n.deliveryDate).getTime(),r=new Date().getTime(),a=i-r;a>0?t[n.id]={days:Math.floor(a/864e5),hours:Math.floor(a%864e5/36e5),minutes:Math.floor(a%36e5/6e4),seconds:Math.floor(a%6e4/1e3)}:t[n.id]={days:0,hours:0,minutes:0,seconds:0}}),w(t)},1e3);return()=>clearInterval(s)},[p]);const fe=async()=>{const s=localStorage.getItem("user_token"),t=localStorage.getItem("user_info");if(!s||!t){$("/login");return}y(JSON.parse(t)),await ge(s),await G(s),await Q(s),await je(s)},ge=async s=>{try{b(!0);const t=await fetch(`https://${x}.supabase.co/functions/v1/make-server-361d74ba/user/projects`,{headers:{Authorization:`Bearer ${u}`,"X-Session-Token":s}}),n=await t.json();t.ok&&A(n.projects||[])}catch(t){console.error("Error fetching projects:",t)}finally{b(!1)}},G=async s=>{try{const t=await fetch(`https://${x}.supabase.co/functions/v1/make-server-361d74ba/user/notifications`,{headers:{Authorization:`Bearer ${u}`,"X-Session-Token":s}}),n=await t.json();t.ok&&(ne(n.notifications||[]),oe(n.notifications.filter(i=>!i.read).length))}catch(t){console.error("Error fetching notifications:",t)}},Q=async s=>{try{const t=await fetch(`https://${x}.supabase.co/functions/v1/make-server-361d74ba/user/messages`,{headers:{Authorization:`Bearer ${u}`,"X-Session-Token":s}}),n=await t.json();t.ok&&ae(n.messages||[])}catch(t){console.error("Error fetching messages:",t)}},je=async s=>{try{const t=await fetch(`https://${x}.supabase.co/functions/v1/make-server-361d74ba/user/messages/unread`,{headers:{Authorization:`Bearer ${u}`,"X-Session-Token":s}}),n=await t.json();t.ok&&le(n.count||0)}catch(t){console.error("Error fetching unread message count:",t)}},we=async s=>{try{const t=localStorage.getItem("user_token");(await fetch(`https://${x}.supabase.co/functions/v1/make-server-361d74ba/user/notifications/${s}/read`,{method:"POST",headers:{Authorization:`Bearer ${u}`,"X-Session-Token":t||""}})).ok&&t&&await G(t)}catch(t){console.error("Error marking notification as read:",t)}},Ne=async s=>{J(!0);try{const t=await fetch(`https://${x}.supabase.co/functions/v1/make-server-361d74ba/user/send-message`,{method:"POST",headers:{Authorization:`Bearer ${u}`,"X-Session-Token":localStorage.getItem("user_token")||"","Content-Type":"application/json"},body:JSON.stringify({message:s})}),n=await t.json();return t.ok?(await Q(localStorage.getItem("user_token")||""),!0):!1}catch(t){return console.error("Error sending message:",t),!1}finally{J(!1)}},C=async s=>{try{const t=localStorage.getItem("user_token"),n=await fetch(`https://${x}.supabase.co/functions/v1/make-server-361d74ba/user/work-submissions/${s}`,{headers:{Authorization:`Bearer ${u}`,"X-Session-Token":t||""}}),i=await n.json();n.ok&&g(i.submissions||[])}catch(t){console.error("Error fetching work submissions:",t)}},T=s=>{const{name:t,value:n}=s.target;D({...d,[t]:n})},ke=async()=>{const s=new Date(d.workDate),t=new Date;if(t.setHours(0,0,0,0),s.setHours(0,0,0,0),s>t){h.error("Cannot submit work for future dates. Please select today or a past date.");return}K(!0);try{const n=localStorage.getItem("user_token"),i=await fetch(`https://${x}.supabase.co/functions/v1/make-server-361d74ba/user/work-submissions`,{method:"POST",headers:{Authorization:`Bearer ${u}`,"X-Session-Token":n||"","Content-Type":"application/json"},body:JSON.stringify({projectId:c==null?void 0:c.id,projectName:c==null?void 0:c.name,workDate:d.workDate,description:d.description,hoursWorked:parseFloat(d.hoursWorked)||0,notes:d.notes})}),r=await i.json();i.ok?(h.success("Work submission successful!"),await C((c==null?void 0:c.id)||""),D({workDate:new Date().toISOString().split("T")[0],description:"",hoursWorked:"",notes:""}),S(!1),f(null),g([])):h.error(r.error||"Failed to submit work. Please try again.")}catch(n){console.error("Error submitting work:",n),h.error("Failed to submit work. Please try again.")}finally{K(!1)}},ve=s=>{L(s),B({workDate:s.workDate,description:s.description,hoursWorked:s.hoursWorked.toString(),notes:s.notes}),U(!0)},ye=s=>{const{name:t,value:n}=s.target;B({...m,[t]:n})},ze=async()=>{const s=new Date(m.workDate),t=new Date;if(t.setHours(0,0,0,0),s.setHours(0,0,0,0),s>t){h.error("Cannot submit work for future dates. Please select today or a past date.");return}V(!0);try{const n=localStorage.getItem("user_token"),i=await fetch(`https://${x}
6.supabase.co/functions/v1/make-server-361d74ba/user/work-submissions/${W==null?void 0:W.id}`,{method:"PUT",headers:{Authorization:`Bearer ${u}`,"X-Session-Token":n||"","Content-Type":"application/json"},body:JSON.stringify({projectId:c==null?void 0:c.id,projectName:c==null?void 0:c.name,workDate:m.workDate,description:m.description,hoursWorked:parseFloat(m.hoursWorked)||0,notes:m.notes})}),r=await i.json();i.ok?(h.success("Work submission updated successfully!"),await C((c==null?void 0:c.id)||""),B({workDate:"",description:"",hoursWorked:"",notes:""}),U(!1),L(null),g([])):h.error(r.error||"Failed to update work submission. Please try again.")}catch(n){console.error("Error updating work submission:",n),h.error("Failed to update work submission. Please try again.")}finally{V(!1)}};return v?e.jsxs(Ce,{user:v,notifications:te,messages:re,unreadCount:ie,unreadMessageCount:ce,showNotifications:de,setShowNotifications:_,showMessages:me,setShowMessages:P,onSendMessage:Ne,sendingMessage:xe,onMarkNotificationAsRead:we,children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:"My Projects"}),e.jsx("p",{className:"text-zinc-400",children:"View and track your assigned projects"})]}),z?e.jsxs("div",{className:"text-center py-12 bg-zinc-900 rounded-lg border border-zinc-800",children:[e.jsx("div",{className:"inline-block w-8 h-8 border-2 border-white border-t-transparent rounded-full animate-spin"}),e.jsx("p",{className:"mt-4 text-zinc-400",children:"Loading projects..."})]}):p.length===0?e.jsxs("div",{className:"text-center py-12 bg-zinc-900 rounded-lg border border-zinc-800",children:[e.jsx(Te,{className:"w-12 h-12 mx-auto text-zinc-600 mb-4"}),e.jsx("p",{className:"text-zinc-400",children:"No projects assigned yet."})]}):e.jsx("div",{className:"space-y-4",children:p.map(s=>e.jsxs("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:"text-2xl font-bold text-white",children:s.name}),e.jsx("div",{className:"flex items-center gap-6",children:j[s.id]&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-center",children:e.jsx("div",{className:"text-2xl font-bold text-white",children:j[s.id].days})}),e.jsx("div",{className:"text-center",children:e.jsx("div",{className:"text-2xl font-bold text-white",children:j[s.id].hours})}),e.jsx("div",{className:"text-center",children:e.jsx("div",{className:"text-2xl font-bold text-white",children:"50"})}),e.jsx("div",{className:"text-center",children:e.jsx("div",{className:"text-2xl font-bold text-white",children:"14"})})]})})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h4",{className:"text-xs font-bold text-zinc-500 mb-3 uppercase tracking-wider",children:"Order Details"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-zinc-800 border border-zinc-700 rounded flex-shrink-0 flex items-center justify-center",children:s.image?e.jsx("img",{src:s.image,alt:s.name,className:"w-full h-full object-cover rounded"}):e.jsx(Me,{className:"w-4 h-4 text-zinc-600"})}),e.jsx("span",{className:"px-3 py-1 rounded text-xs font-bold uppercase bg-blue-600 text-white",children:s.status})]})]}),e.jsxs("div",{className:"flex items-center gap-8 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"w-4 h-4 text-zinc-500"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-zinc-500 mb-0.5",children:"Price"}),e.jsxs("div",{className:"text-white font-bold",children:["$",s.price]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-4 h-4 text-zinc-500"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-zinc-500 mb-0.5",children:"Start Date"}),e.jsx("div",{className:"text-white font-bold",children:new Date(s.startDate).toLocaleDateString("en-US",{month:"numeric",day:"numeric",year:"numeric"})})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-4 h-4 text-zinc-500"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-zinc-500 mb-0.5",children:"Delivery Date"}),e.jsx("div",{className:"text-white font-bold",children:new Date(s.deliveryDate).toLocaleDateString("en-US",{month:"numeric",day:"numeric",year:"numeric"})})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{onClick:()=>
6{f(s),C(s.id),q(!0)},className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-white text-black rounded hover:bg-zinc-100 transition-colors text-sm font-medium",children:[e.jsx(se,{className:"w-4 h-4"}),e.jsx("span",{children:"See Submissions"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("button",{onClick:()=>{f(s),S(!0),C(s.id)},className:"flex items-center justify-center gap-2 px-4 py-2.5 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-sm font-medium",children:[e.jsx(Z,{className:"w-4 h-4"}),e.jsx("span",{children:"Submit Work"})]}),e.jsxs("button",{onClick:()=>{P(!0),_(!1)},className:"flex items-center justify-center gap-2 px-4 py-2.5 bg-white text-black rounded hover:bg-zinc-100 transition-colors text-sm font-medium",children:[e.jsx(Ie,{className:"w-4 h-4"}),e.jsx("span",{children:"Message"})]})]})]})]},s.id))}),ue&&c&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-zinc-900 rounded-lg w-full max-w-3xl max-h-[90vh] overflow-hidden border border-zinc-800 shadow-2xl",children:[e.jsxs("div",{className:"px-6 py-4 border-b border-zinc-800 flex items-center justify-between bg-zinc-900",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold text-white",children:"Submit Daily Work"}),e.jsx("p",{className:"text-sm text-zinc-400 mt-1",children:c.name})]}),e.jsx("button",{onClick:()=>{S(!1),f(null),g([]),D({workDate:new Date().toISOString().split("T")[0],description:"",hoursWorked:"",notes:""})},className:"text-zinc-400 hover:text-white transition-colors",children:e.jsx(X,{className:"w-6 h-6"})})]}),e.jsxs("div",{className:"p-6 overflow-y-auto",style:{maxHeight:"calc(90vh - 180px)"},children:[e.jsxs("div",{className:"bg-zinc-800 rounded-lg p-6 mb-6 border border-zinc-700",children:[e.jsx("h3",{className:"text-lg font-bold text-white mb-4",children:"Log Your Work"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-zinc-300 mb-2",children:["Date ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"date",name:"workDate",value:d.workDate,onChange:T,max:new Date().toISOString().split("T")[0],className:"w-full px-4 py-2 bg-zinc-900 border border-zinc-700 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-blue-500"}),e.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"You can only submit work for today or past dates"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-zinc-300 mb-2",children:["Work Description ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("textarea",{name:"description",value:d.description,onChange:T,placeholder:"Describe what you worked on today...",rows:4,className:"w-full px-4 py-2 bg-zinc-900 border border-zinc-700 rounded-lg text-white placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-2",children:"Hours Worked"}),e.jsx("input",{type:"number",name:"hoursWorked",step:"0.5",min:"0",value:d.hoursWorked,onChange:T,placeholder:"e.g., 8 or 4.5",className:"w-full px-4 py-2 bg-zinc-900 border border-zinc-700 rounded-lg text-white placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-2",children:"Additional Notes"}),e.jsx("textarea",{name:"notes",value:d.notes,onChange:T,placeholder:"Any additional comments or notes...",rows:3,className:"w-full px-4 py-2 bg-zinc-900 border border-zinc-700 rounded-lg text-white placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx(I,{onClick:()=>{S(!1),f(null),g([]),D({workDate:new Date().toISOString().split("T")[0],description:"",hoursWorked:"",notes:""})},variant:"outline",className:"border-zinc-700 text-black hover:bg-zinc-100",disabled:F,children:"Cancel"}),e.jsx(I,{onClick:ke,className:"bg-blue-600 hover:bg-blue-700 text-white",disabled:F||!d.description.trim(),children:F?"Submitting...":"Submit Work"})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-white mb-4",children:"Work History"}),N.length===0?e.jsxs("div",{className:"text-center py-8 bg-zinc-800 rounded-lg border border-zinc-700",children:[e.jsx(Z,{className:"w-12 h-12 mx-auto text-zinc-600 mb-2"}),e.jsx("p",{className:"text-zinc-400",children:"No work submissions yet"})]}):(()=>{const s={};
6N.forEach(n=>{const i=n.workDate;s[i]||(s[i]=[]),s[i].push(n)});const t=Object.keys(s).sort((n,i)=>new Date(i).getTime()-new Date(n).getTime());return e.jsx("div",{className:"space-y-4",children:t.map(n=>{const i=s[n],r=i.reduce((a,M)=>a+M.hoursWorked,0);return e.jsxs("div",{className:"bg-zinc-800 border border-zinc-700 rounded-lg overflow-hidden",children:[e.jsx("div",{className:"p-4 bg-zinc-800/50",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-5 h-5 text-blue-400"}),e.jsx("h4",{className:"font-semibold text-white",children:new Date(n).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs text-zinc-400",children:[i.length," submission",i.length!==1?"s":""]}),r>0&&e.jsxs("span",{className:"px-2 py-1 bg-blue-500/20 text-blue-400 text-xs font-medium rounded border border-blue-500/30 flex items-center gap-1",children:[e.jsx(ee,{className:"w-3 h-3"}),r,"h"]})]})]})}),e.jsx("div",{className:"p-4 space-y-3",children:i.map(a=>e.jsxs("div",{className:"bg-zinc-900 rounded-lg p-4 border border-zinc-700",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-zinc-500 uppercase",children:"Description"}),e.jsx("p",{className:"text-sm text-zinc-300 mt-1",children:a.description})]}),a.notes&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-zinc-500 uppercase",children:"Notes"}),e.jsx("p",{className:"text-sm text-zinc-300 mt-1",children:a.notes})]})]}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-zinc-700 text-xs text-zinc-500",children:["Submitted: ",new Date(a.createdAt).toLocaleString()]})]},a.id))})]},n)})})})()]})]})]})}),he&&c&&(()=>{let s=N;k&&(s=N.filter(r=>r.workDate===k));const t={};s.forEach(r=>{const a=r.workDate;t[a]||(t[a]=[]),t[a].push(r)});const n=Object.keys(t).sort((r,a)=>new Date(a).getTime()-new Date(r).getTime()),i=Array.from(new Set(N.map(r=>r.workDate))).sort((r,a)=>new Date(a).getTime()-new Date(r).getTime());return e.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg max-w-3xl w-full max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"p-6 border-b border-zinc-800 sticky top-0 bg-zinc-900 z-10",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold text-white",children:"Work Submissions"}),e.jsx("p",{className:"text-sm text-zinc-400 mt-1",children:c.name})]}),e.jsx("button",{onClick:()=>{q(!1),f(null),g([]),O("")},className:"p-2 hover:bg-zinc-800 rounded",children:e.jsx(X,{className:"w-5 h-5 text-zinc-400"})})]}),i.length>0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("label",{className:"text-sm font-medium text-zinc-300 flex items-center gap-2",children:[e.jsx(E,{className:"w-4 h-4"}),"Filter by Date:"]}),e.jsxs("select",{value:k,onChange:r=>O(r.target.value),className:"flex-1 px-3 py-2 bg-zinc-800 border border-zinc-700 rounded-lg text-white text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[e.jsx("option",{value:"",children:"All Dates"}),i.map(r=>e.jsx("option",{value:r,children:new Date(r).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"})},r))]}),k&&e.jsx("button",{onClick:()=>O(""),className:"px-3 py-2 bg-zinc-800 hover:bg-zinc-700 text-white text-sm rounded-lg transition-colors",children:"Clear"})]})]}),e.jsx("div",{className:"p-6 space-y-4",children:n.length>0?n.map(r=>{const a=t[r],M=a.reduce((l,Se)=>l+Se.hoursWorked,0),H=R.has(r);return e.jsxs("div",{className:"bg-zinc-800 border border-zinc-700 rounded-lg overflow-hidden",children:[e.jsx("button",{onClick:()=>{const l=new Set(R);H?l.delete(r):l.add(r),be(l)},className:"w-full p-4 flex items-center justify-between hover:bg-zinc-750 transition-colors",children:e.jsxs("div",{className:"flex items-center gap-3",children:[H?e.jsx($e,{className:"w-5 h-5 text-zinc-400"}):e.jsx(Ae,{className:"w-5 h-5 text-zinc-400"}),e.jsxs("div",{className:"text-left",children:[e.jsx("h3",{className:"font-semibold text-white",children:new Date(r).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),e.jsxs("p",{className:"text-sm text-zinc-400",children:[a.length," submission",a.length!==1?"s":""," ⢠",M," hour",M!==1?"s":""]})]})]})}),H&&e.jsx("div",{className:"border-t border-zinc-700 p-4 space-y-3",children:a.map(l
6=>e.jsxs("div",{className:"bg-zinc-900 border border-zinc-700 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("div",{children:e.jsx("h4",{className:"font-medium text-white",children:"Work Details"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"px-2 py-1 bg-blue-500/20 text-blue-400 text-xs font-medium rounded border border-blue-500/30 flex items-center gap-1",children:[e.jsx(ee,{className:"w-3 h-3"}),l.hoursWorked,"h"]}),e.jsx("button",{onClick:()=>ve(l),className:"p-1.5 hover:bg-zinc-800 rounded transition-colors",title:"Edit submission",children:e.jsx(Fe,{className:"w-4 h-4 text-zinc-400"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-zinc-500 uppercase",children:"Description"}),e.jsx("p",{className:"text-sm text-zinc-300 mt-1",children:l.description})]}),l.notes&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-zinc-500 uppercase",children:"Notes"}),e.jsx("p",{className:"text-sm text-zinc-300 mt-1",children:l.notes})]})]}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-zinc-700 text-xs text-zinc-500",children:["Submitted: ",new Date(l.createdAt).toLocaleString()]})]},l.id))})]},r)}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(se,{className:"w-12 h-12 text-zinc-600 mx-auto mb-3"}),e.jsx("p",{className:"text-zinc-400",children:k?"No submissions found for this date":"No work submissions yet for this project"})]})})]})})})(),Y&&W&&e.jsx(Le,{isOpen:Y,workDate:m.workDate,description:m.description,hoursWorked:m.hoursWorked,notes:m.notes,onChange:ye,onSubmit:ze,onClose:()=>{U(!1),L(null)},isSubmitting:pe})]}):e.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:e.jsx("div",{className:"inline-block w-8 h-8 border-2 border-white border-t-transparent rounded-full animate-spin"})})}export{ss 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.