diff --git a/src/components/ServiceProject/ManageJobTicket.jsx b/src/components/ServiceProject/ManageJobTicket.jsx index 7339c9a8..5f29b125 100644 --- a/src/components/ServiceProject/ManageJobTicket.jsx +++ b/src/components/ServiceProject/ManageJobTicket.jsx @@ -7,6 +7,7 @@ import Avatar from "../common/Avatar"; import EmployeeAvatarGroup from "../common/EmployeeAvatarGroup"; import JobStatusLog from "./JobStatusLog"; import JobComments from "./JobComments"; +import { daysLeft } from "../../utils/appUtils"; const ManageJobTicket = ({ Job }) => { const { data, isLoading, isError, error } = useServiceProjectJobDetails( @@ -17,14 +18,14 @@ const ManageJobTicket = ({ Job }) => { { id: "comment", title: "Comments", - icon:"bx bx-comment me-2", + icon: "bx bx-comment me-2", active: true, content: , }, { id: "history", title: "History", - icon:"bx bx-time me-2", + icon: "bx bx-time me-2", active: false, content: , }, @@ -41,56 +42,79 @@ const ManageJobTicket = ({ Job }) => { return (
-
{data?.title}
-
-
- {" "} - {formatUTCToLocalTime(data?.createdAt, true)} -
+
{data?.status?.name} + {data?.dueDate && (() => { + const { days, color } = daysLeft(data?.startDate, data?.dueDate); + return ( + + Days Left : + + {days !== null ? `${days} days` : "N/A"} + + + ); + })()} +
-
-

{data?.description}

+
{data?.title}
+ +
+

+ Description : + {data?.description || "N/A"} +

-
- - Start Date : {formatUTCToLocalTime(data?.startDate)} - {" "} - {" "} - - Due on : {formatUTCToLocalTime(data?.startDate)} - + + +
+
+ {" "} + Created Date : {formatUTCToLocalTime(data?.createdAt, true)} +
-
+ +
+
+ + Start Date : {formatUTCToLocalTime(data?.startDate)} + {" "} + {" "} + + Due on : {formatUTCToLocalTime(data?.startDate)} + +
+
+
- - Created By - {" "} + + Created By + {" "} {" "} -
-

{`${data?.createdBy?.firstName} ${data?.createdBy?.lastName}`}

- ({data?.createdBy?.jobRoleName}) -
+
+

{`${data?.createdBy?.firstName} ${data?.createdBy?.lastName}`}

+ ({data?.createdBy?.jobRoleName}) +
- - Assigned + + Assigned By -
- {data?.assignees?.map((emp)=>( +
+ {data?.assignees?.map((emp) => (
- +

{`${emp.firstName} ${emp.lastName}`}

- ( {emp.jobRoleName} ) -
+ ({emp.jobRoleName})
+
))} -
+
@@ -106,7 +130,7 @@ const ManageJobTicket = ({ Job }) => { data-bs-target={`#tab-${tab.id}`} role="tab" > - {tab.title} + {tab.title} ))} diff --git a/src/components/common/OffcanvasComponent.jsx b/src/components/common/OffcanvasComponent.jsx index 970785ae..f9e2d1c1 100644 --- a/src/components/common/OffcanvasComponent.jsx +++ b/src/components/common/OffcanvasComponent.jsx @@ -6,7 +6,7 @@ const OffcanvasComponent = ({ placement = "start", // start | end | top | bottom children, show = false, - onClose = () => {}, + onClose = () => { }, }) => { const offcanvasRef = useRef(null); const bsInstance = useRef(null); @@ -45,11 +45,19 @@ const OffcanvasComponent = ({ aria-labelledby={`${id}-label`} >
-
-
{title}
-
- +
+ + +
+ {title} +
+
+ +