Improve image fallbacks and status display

This commit adds reusable client and end-user fallback assets and updates profile cards, lists, and assignment views to render graceful placeholders when images are missing or fail to load. It also hardens the shared LazyImage component with fallback handling and improves BadgeStatus so it accepts object-like status values and still renders clean labels. Minor UX fixes include dismissing upload toasts after completion and clarifying end-user form labels/copy.
This commit is contained in:
Ichsan Kurniawan
2026-10-07 12:16:03 +07:00
parent c6ecabd084
commit 3f0ed29f0c
12 changed files with 119 additions and 87 deletions
@@ -1,4 +1,4 @@
import { IClient } from '../../types';
import { IClient, CLIENT_FALLBACK_IMAGE } from '../../types';
import { motion } from 'motion/react';
import { Card900, CardContent } from '@/components/ui/card';
import Link from 'next/link';
@@ -50,7 +50,8 @@ export default function ClientList({ clients, onEdit, onDelete }: ClientListProp
<div className="relative w-full lg:w-56 xl:w-64 h-48 lg:h-auto min-h-40 bg-muted/20 dark:bg-zinc-800/20 shrink-0 overflow-hidden flex items-center justify-center p-3 border-b lg:border-b-0 lg:border-r border-border/50">
<Link href={`/task/client-detail/${client.id}`} className="w-full h-full flex items-center justify-center">
<LazyImage
src={client.photo!}
src={client.photo || CLIENT_FALLBACK_IMAGE}
fallbackSrc={CLIENT_FALLBACK_IMAGE}
alt={client.name}
className="w-full h-full max-h-36 bg-transparent"
imgClassName="object-contain p-1 group-hover:scale-105 transition-transform duration-500"