Files
ServerKit/frontend/src/components/EmptyState.jsx
T
Juan DenisandClaude Opus 4.8 e1088aff71 feat(frontend): skeleton loaders, branded AppLoader, favicon refresh
Replace spinners with skeleton placeholders across page/section loaders
(EmptyState, DataTable, and ~page surfaces), add a reusable Skeleton
component + _skeleton.scss, rework AppLoader into a branded "server
powering on" loader, and refresh the favicon set (incl. SVG icon link).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 21:44:40 -04:00

60 lines
2.1 KiB
React

import { Inbox } from 'lucide-react';
import { Skeleton } from './Skeleton';
export default function EmptyState({
icon: Icon = Inbox,
title = 'No items found',
description = '',
action = null,
size = 'default',
loading = false
}) {
if (loading) {
// Skeleton placeholder (not a spinner): a generic panel shape that reads
// as "content is loading" across the ~40 page/section loaders that use it.
return (
<div
className={`empty-state empty-state--${size} empty-state--loading`}
role="status"
aria-busy="true"
aria-label={title || 'Loading'}
>
<div className="skeleton-panel">
<div className="skeleton-panel__head">
<Skeleton variant="avatar" />
<div className="skeleton-panel__head-text">
<Skeleton variant="title" width="42%" />
<Skeleton variant="line" width="26%" />
</div>
</div>
<div className="skeleton-panel__cards">
<Skeleton variant="card" />
<Skeleton variant="card" />
<Skeleton variant="card" />
</div>
<div className="skeleton-panel__rows">
<Skeleton variant="line" width="100%" />
<Skeleton variant="line" width="92%" />
<Skeleton variant="line" width="76%" />
</div>
</div>
</div>
);
}
return (
<div className={`empty-state empty-state--${size}`}>
<div className="empty-state__icon">
<Icon size={size === 'lg' ? 64 : 48} />
</div>
<h3 className="empty-state__title">{title}</h3>
{description && (
<p className="empty-state__description">{description}</p>
)}
{action && (
<div className="empty-state__action">{action}</div>
)}
</div>
);
}