fixing typeerror production build

This commit is contained in:
Ichsan Kurniawan
2026-04-30 14:11:00 +07:00
parent c34aab579a
commit cca357c37d
4 changed files with 8 additions and 20 deletions
@@ -59,7 +59,7 @@ export default async function ClientDetailPage({ params, searchParams }: Props)
);
// --- Status Filter ---
const itemStatus = item.project_status?.name?.toLowerCase();
const itemStatus = item.project_assignment_status?.name?.toLowerCase();
const matchesStatus = activeStatuses.length === 0 || (itemStatus && activeStatuses.includes(itemStatus));
return matchesSearch && matchesStatus;
@@ -7,10 +7,8 @@ import { Card, CardContent, CardHeader, CardTitle, CardDescription, Card900 } fr
import { Badge } from '@/components/ui/badge';
import { Separator } from '@/components/ui/separator';
import { Label } from '@/components/ui/label';
import { cn } from '@/lib/utils';
import { useRouter } from 'next/navigation';
import { useState } from 'react';
import FormUpdateStatus from '@/app/(dashboard)/task/component/UpdateTimelineStatus';
import { IClient } from '@/app/(dashboard)/task/types';
import { IProjectAssignment } from '@/app/(dashboard)/task/type.assignment';
import { IProject } from '@/app/(dashboard)/task/type.project';
@@ -132,7 +130,7 @@ export default function ProjectDetailComponent({ client, project }: Props) {
<div className="space-y-3 flex-1">
<div className="flex items-center gap-3">
<h3 className="text-xl font-bold">{assignment.wo_name}</h3>
<BadgeStatus status={assignment.project_status.name} />
<BadgeStatus status={assignment.project_assignment_status?.name} />
</div>
<p className="text-muted-foreground text-sm">{assignment.wo_description ?? 'No description available for this project!'}</p>
<div className="flex flex-wrap gap-4 text-xs text-muted-foreground">
@@ -163,10 +161,10 @@ export default function ProjectDetailComponent({ client, project }: Props) {
<div className="w-2 h-2 rounded-full bg-primary mt-1.5 shrink-0" />
<div>
<div className="flex items-center gap-2">
<span className="font-bold">{history.status}</span>
<span className="text-muted-foreground text-xs">{new Date(history.date_status_changed).toLocaleDateString()}</span>
<span className="font-bold">{history.project_assignment_status.name}</span>
<span className="text-muted-foreground text-xs">{new Date(history.updated_at!).toLocaleDateString()}</span>
</div>
<p className="text-muted-foreground text-xs mt-0.5">{history.status_remarks}</p>
{/* <p className="text-muted-foreground text-xs mt-0.5">{history.status_remarks}</p> */}
</div>
</div>
))}
@@ -182,16 +180,6 @@ export default function ProjectDetailComponent({ client, project }: Props) {
</div>
</div>
</motion.div>
{action === 'ASSIGNMENT' ?
<FormUpdateStatus data={selectedData} title={`${project.name} (Project)`} onCancel={handleClose} onSuccess={handleSuccess} />
: null
}
{action === 'WO' ?
<FormUpdateStatus data={selectedData} title={`${selectedData?.wo_name} (Work Order)`} onCancel={handleClose} onSuccess={handleSuccess} />
: null
}
</>
);
}
@@ -100,10 +100,10 @@ export default function AssignmentTable({ data }: { data: IProjectAssignment[] }
{assignment.wo_end_date ? new Date(assignment.wo_end_date).toLocaleDateString() : ''}
</TableCell>
<TableCell>
<BadgeStatus status={assignment.project?.status || assignment.project_status?.name} />
<BadgeStatus status={assignment.project?.status || assignment.project_assignment_status?.name} />
</TableCell>
<TableCell>
{assignment.project_assignment_status_detail[0]?.status_remarks}
{assignment.note ? <span className="text-sm text-muted-foreground italic max-w-xs truncate" title={assignment.note}>{assignment.note}</span> : ''}
</TableCell>
<TableCell>
<div className="flex -space-x-2 overflow-hidden">
+1 -1
View File
@@ -55,7 +55,7 @@ export const getFilteredAssignments = (assignmentList: IProjectAssignment[], que
);
// --- Status Filter ---
const itemStatus = item.project_status?.name?.toLowerCase();
const itemStatus = item.project_assignment_status?.name?.toLowerCase();
const matchesStatus = activeStatuses.length === 0 || (itemStatus && activeStatuses.includes(itemStatus));
return matchesSearch && matchesStatus;