mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-06 23:26:28 +00:00
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:
@@ -17,7 +17,7 @@ import {
|
||||
} from "@/components/ui/hover-card";
|
||||
import { cn } from '@/lib/utils';
|
||||
import BadgeStatus from '@/components/ui/badge-status';
|
||||
import { IClient } from '../../types';
|
||||
import { IClient, CLIENT_FALLBACK_IMAGE } from '../../types';
|
||||
|
||||
interface ClientGridProps {
|
||||
clients: IClient[];
|
||||
@@ -49,7 +49,8 @@ export default function ClientGrid({ clients, onEdit, onDelete }: ClientGridProp
|
||||
<div className="relative h-40 bg-muted/20 dark:bg-zinc-800/30 overflow-hidden flex items-center justify-center p-3 border-b 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-32 bg-transparent"
|
||||
imgClassName="object-contain p-1 group-hover:scale-105 transition-transform duration-500"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user