diff --git a/app/(dashboard)/task/client-detail/[client_id]/[assignment_id]/AssignmentDetailComponent.tsx b/app/(dashboard)/task/client-detail/[client_id]/[assignment_id]/AssignmentDetailComponent.tsx index 4beb224..a6c112c 100644 --- a/app/(dashboard)/task/client-detail/[client_id]/[assignment_id]/AssignmentDetailComponent.tsx +++ b/app/(dashboard)/task/client-detail/[client_id]/[assignment_id]/AssignmentDetailComponent.tsx @@ -244,7 +244,7 @@ function MetaTile({ icon: Icon, label, value }: { icon: typeof Briefcase; label: function PartyCard({ label, party, accent }: { label: string; party: any; accent: string }) { function initials(name: string) { - return name.split(" ").map((n) => n[0]).filter(Boolean).slice(0, 2).join("").toUpperCase(); + return name?.split(" ").map((n) => n[0]).filter(Boolean).slice(0, 2).join("").toUpperCase(); } return ( @@ -254,17 +254,17 @@ function PartyCard({ label, party, accent }: { label: string; party: any; accent
- {party.photo ? - + {party?.photo ? + :
- {initials(party.name)} + {initials(party?.name)}
}
-

{party.name}

-

{party.description ?? 'No description available.'}

+

{party?.name}

+

{party?.description ?? 'No description available.'}

diff --git a/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/AssignedPeople.tsx b/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/AssignedPeople.tsx index 5047b2a..4b31389 100644 --- a/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/AssignedPeople.tsx +++ b/app/(dashboard)/task/client-detail/[client_id]/project-detail/[project_id]/AssignedPeople.tsx @@ -15,7 +15,7 @@ interface Props { const AssignedPeople = ({ people, defaultOpen = true }: Props) => { const [isOpen, setIsOpen] = useState(defaultOpen); - if (people.length === 0) { + if (people?.length === 0) { return (
No team assigned yet @@ -29,17 +29,17 @@ const AssignedPeople = ({ people, defaultOpen = true }: Props) => {
- {people.slice(0, 5).map((user, i) => + {people?.slice(0, 5).map((user, i) => )} - {people.length > 5 && + {people?.length > 5 &&
- +{people.length - 5} + +{people?.length - 5}
}
-

{people.length} People

+

{people?.length} People

assigned to this work order