PageSourceSearch

https://zynko.ai/assets/ClientCommunication-D5eNyvzY.js

js zynko.ai collected 2026-10-05 13:21:55 UTC 11,486 bytes, 6 lines download raw bytes

1import{c as M,r as A,b as K,d as H,e as N,f as I,j as e,C as l,h as d,i as m,o as y,k as i,B as D}from"./index-BIPYIMZ0.js";import{B as a}from"./badge-Cb995QYd.js";import{S as Q}from"./separator-BIAGQvJu.js";import{T as V,a as z,b as f,c as v}from"./tabs-vughXrH9.js";import{S as L}from"./scroll-area-CmXmkB7J.js";import{M as o}from"./message-square-C9oO_Xsk.js";import{C as b}from"./calendar-CBAuEOwJ.js";import{E as w}from"./external-link-DTtxvel1.js";import{R as F}from"./rocket-UDB9-oOO.js";import{C as W}from"./circle-check-big-DjuJuMVs.js";import"./index-BdQq_4o_.js";/**
2 * @license lucide-react v0.453.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 C=M("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);function le(){const[t,T]=A.useState(null);K();const U=H(),{data:x,isLoading:$}=N({queryKey:["/api/client/notifications"],enabled:!0}),{data:u,isLoading:P}=N({queryKey:["/api/client/projects"],enabled:!0}),{data:h,isLoading:R}=N({queryKey:[`/api/client/projects/${t==null?void 0:t.id}/updates`],enabled:!!t}),_=I({mutationFn:async s=>{const r=await fetch(`/api/client/notifications/${s}/read`,{method:"PATCH",credentials:"include"});if(!r.ok)throw new Error("Failed to mark notification as read");return r.json()},onSuccess:()=>{U.invalidateQueries({queryKey:["/api/client/notifications"]})}}),p=(x==null?void 0:x.notifications)||[],n=(u==null?void 0:u.projects)||[],S=(h==null?void 0:h.updates)||[],c=p.filter(s=>!s.isRead).length,q=s=>{s.isRead||_.mutate(s.id),s.actionUrl&&(s.actionUrl.startsWith("http")?window.open(s.actionUrl,"_blank"):window.location.href=s.actionUrl)},E=s=>{switch(s){case"payment":return e.jsx(W,{className:"h-4 w-4 text-green-600"});case"status_update":return e.jsx(o,{className:"h-4 w-4 text-blue-600"});case"milestone":return e.jsx(b,{className:"h-4 w-4 text-purple-600"});case"deployment":return e.jsx(F,{className:"h-4 w-4 text-orange-600"});default:return e.jsx(C,{className:"h-4 w-4 text-gray-600"})}},B=s=>{switch(s){case"urgent":return"bg-red-100 text-red-800 border-red-200";case"high":return"bg-orange-100 text-orange-800 border-orange-200";case"normal":return"bg-blue-100 text-blue-800 border-blue-200";case"low":return"bg-gray-100 text-gray-800 border-gray-200";default:return"bg-gray-100 text-gray-800 border-gray-200"}},j=s=>{switch(s){case"in_development":return"bg-blue-100 text-blue-800";case"deployed":return"bg-green-100 text-green-800";case"completed":return"bg-purple-100 text-purple-800";default:return"bg-gray-100 text-gray-800"}},g=s=>{switch(s){case"staging":return"bg-yellow-100 text-yellow-800";case"production":return"bg-green-100 text-green-800";case"live":return"bg-purple-100 text-purple-800";default:return"bg-gray-100 text-gray-800"}},k=s=>new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});return $||P?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"animate-spin w-8 h-8 border-4 border-primary border-t-transparent rounded-full"})}):e.jsxs("div",{className:"max-w-6xl mx-auto p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Project Communication"}),e.jsx("p",{className:"text-muted-foreground",children:"Stay updated on your project progress and notifications"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(a,{variant:"secondary",className:"px-3 py-1",children:[n.length," Active Projects"]}),c>0&&e.jsxs(a,{variant:"destructive",className:"px-3 py-1",children:[c," Unread"]})]})]}),e.jsxs(V,{defaultValue:"notifications",className:"space-y-4",children:[e.jsxs(z,{className:"grid w-full grid-cols-3",children:[e.jsxs(f,{value:"notifications",className:"flex items-center gap-2",children:[e.jsx(C,{className:"h-4 w-4"}),"Notifications",c>0&&e.jsx(a,{variant:"destructive",className:"ml-1 h-5 w-5 p-0 text-xs",children:c})]}),e.jsxs(f,{value:"projects",className:"flex items-center gap-2",children:[e.jsx(o,{className:"h-4 w-4"}),"Project Updates"]}),e.jsxs(f,{value:"timeline",className:"flex items-center gap-2",children:[e.jsx(b,{className:"h-4 w-4"}),"Timeline"]})]}),e.jsx(v,{value:"notifications",className:"space-y-4",children:e.jsxs(l,{children:[e.jsxs(d,{children:[e.jsx(m,{children:"Recent Notifications"}),e.jsx(y,{children:"Important updates about your projects and account"})]}),e.jsx(i,{children:e.jsx(L,{className:"h-[600px]",children:e.jsx("div",{className:"space-y-3",children:p.length>0?p.map(s=>e.jsx("div",{className:`p-4 border rounded-lg cursor-pointer transition-colors hover:bg-muted/50 ${s.isRead?"":"bg-blue-50 border-blue-200"}`,onClick:()=>q(s),children:e.jsxs("div",{className:"flex items-start gap-3",children:[E(s.type),e.jsx("div",{className:"flex-1",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-sm",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s.message}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:k(s.createdAt)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(a,{className:`text-xs ${B(s.priority)}`,children:s.priority}),s.actionUrl&&e.jsx(w,{className:"h-3 w-3 text-muted-foreground"})]})]})})]})},s.id)):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(C,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{children:"No notifications yet"})]})})})})]})}),e.jsx(v,{value:"projects",className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsx("div",{className:"lg:col-span-1",children:e.jsxs(l,{children:[e.jsx(d,{children:e.jsx(m,{children:"Your Projects"})}),e.jsx(i,{className:"space-y-3",children:n.map(s=>e.jsxs("div",{className:`p-3 border rounded-lg cursor-pointer transition-colors ${(t==null?void 0:t.id)===s.id?"border-primary bg-primary/5":"hover:bg-muted/50"}`,onClick:()=>T(s),children:[e.jsx("h3",{className:"font-medium text-sm",children:s.title}),e.jsxs("div",{className:"flex items-center justify-between mt-2",children:[e.jsx(a,{className:`text-xs ${j(s.status)}`,children:s.status.replace("_"," ")}),s.deploymentStatus&&e.jsx(a,{className:`text-xs ${g(s.deploymentStatus)}`,children:s.deploymentStatus})]})]},s.id))})]})}),e.jsx("div",{className:"lg:col-span-2",children:t?e.jsxs(l,{children:[e.jsxs(d,{children:[e.jsx(m,{children:t.title}),e.jsx(y,{children:"Project updates and communications"})]}),e.jsx(i,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 p-4 bg-muted/30 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Status"}),e.jsx(a,{className:`mt-1 ${j(t.status)}`,children:t.status.replace("_"," ")})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Deployment"}),e.jsx(a,{className:`mt-1 ${g(t.deploymentStatus||"pending")}`,children:t.deploymentStatus||"pending"})]}),t.estimatedDeliveryDate&&e.jsxs("div",{className:"col-span-2",children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Estimated Delivery"}),e.jsx("p",{className:"text-sm mt-1",children:new Date(t.estimatedDeliveryDate).toLocaleDateString()})]})]}),e.jsxs("div",{className:"space-y-3",children:[t.stagingUrl&&e.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Staging Environment"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Preview your project in development"})]}),e.jsxs(D,{size:"sm",variant:"outline",onClick:()=>window.open(t.stagingUrl,"_blank"),children:[e.jsx(w,{className:"h-4 w-4 mr-1"}),"View"]}
6)]}),t.productionUrl&&e.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Live Website"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your deployed website"})]}),e.jsxs(D,{size:"sm",onClick:()=>window.open(t.productionUrl,"_blank"),children:[e.jsx(w,{className:"h-4 w-4 mr-1"}),"Visit Site"]})]})]}),e.jsx(Q,{}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium mb-3",children:"Recent Updates"}),e.jsx(L,{className:"h-[300px]",children:e.jsx("div",{className:"space-y-3",children:R?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx("div",{className:"animate-spin w-6 h-6 border-2 border-primary border-t-transparent rounded-full"})}):S.length>0?S.map(s=>e.jsx("div",{className:"p-3 border rounded-lg",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h5",{className:"font-medium text-sm",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s.content}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:k(s.createdAt)})]}),e.jsx(a,{variant:"outline",className:"text-xs",children:s.updateType.replace("_"," ")})]})},s.id)):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(o,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No updates yet"})]})})})]})]})})]}):e.jsx(l,{children:e.jsx(i,{className:"flex items-center justify-center h-64",children:e.jsxs("div",{className:"text-center",children:[e.jsx(o,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),e.jsx("h3",{className:"font-medium mb-2",children:"Select a Project"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a project to view updates and communications"})]})})})})]})}),e.jsx(v,{value:"timeline",className:"space-y-4",children:e.jsxs(l,{children:[e.jsxs(d,{children:[e.jsx(m,{children:"Project Timeline"}),e.jsx(y,{children:"Track milestones and key events across all your projects"})]}),e.jsx(i,{children:e.jsx("div",{className:"space-y-6",children:n.length>0?n.map(s=>{var r;return e.jsx("div",{className:"relative",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"w-3 h-3 bg-primary rounded-full"}),e.jsx("div",{className:"w-px h-16 bg-border"})]}),e.jsxs("div",{className:"flex-1 pb-8",children:[e.jsx("h4",{className:"font-medium",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:((r=s.selectedPlan)==null?void 0:r.name)||"No plan selected"}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx(a,{className:`text-xs ${j(s.status)}`,children:s.status.replace("_"," ")}),s.deploymentStatus&&e.jsx(a,{className:`text-xs ${g(s.deploymentStatus)}`,children:s.deploymentStatus})]}),s.estimatedDeliveryDate&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Expected: ",new Date(s.estimatedDeliveryDate).toLocaleDateString()]})]})]})},s.id)}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(b,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{children:"No projects to display"})]})})})]})})]})]})}export{le 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.