feat: add error boundary, glass shimmer skeleton, empty state

- Create ErrorBoundary class component with GlassCard fallback UI
- Update LoadingSkeleton with glass shimmer animation overlay
- Update EmptyState with GlassPanel and default Inbox icon
- Add ErrorBoundary to shared components index export

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Developer
2026-07-28 11:41:09 +07:00
co-authored by Claude Opus 4.8
parent 2b06d82450
commit 1c6f98117a
4 changed files with 73 additions and 33 deletions
@@ -1,26 +1,25 @@
"use client";
import type { LucideIcon } from "lucide-react";
import { Inbox } from "lucide-react";
import { GlassPanel } from "@/components/glass/panel";
interface EmptyStateProps {
icon: LucideIcon;
title: string;
icon?: LucideIcon;
title?: string;
description?: string;
}
/**
* Consistent empty state for data-fetching pages.
*/
export function EmptyState({
icon: Icon,
title,
description,
icon: Icon = Inbox,
title = "No data yet",
description = "Nothing to display here yet.",
}: EmptyStateProps) {
return (
<div className="flex flex-col items-center justify-center py-20 text-center">
<Icon className="size-10 text-muted-foreground/40 mb-3" />
<p className="text-sm text-muted-foreground">{title}</p>
{description && (
<p className="text-xs text-muted-foreground/60 mt-1">{description}</p>
)}
</div>
<GlassPanel dense className="flex flex-col items-center gap-2 py-12">
<Icon className="size-8 text-text-secondary/20" />
<p className="text-sm text-text-secondary/60">{title}</p>
<p className="text-xs text-text-secondary/40">{description}</p>
</GlassPanel>
);
}