refactor: decompose monolithic App.tsx into per-component files
- Extract views to src/components/views/ (Overview, Logbook, Trends, Settings, Auth) - Extract standalone components (EntryModal, ImportPreviewModal, ConfirmDialog, Sidebar, TopBar, MobileNav, EntryLedger, FiltersPanel, QuickAddPanel, etc.) - Move shared helpers to src/lib (dashboard, filters, userDisplay) and static data to src/data (accents, quickAdds) - App.tsx now orchestration-only (2971 -> 777 lines); no behavior change
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { Plus, Zap } from "lucide-react";
|
||||
|
||||
type EmptyStateProps = {
|
||||
title: string;
|
||||
copy: string;
|
||||
actionLabel?: string;
|
||||
onAction?: () => void;
|
||||
};
|
||||
|
||||
export function EmptyState({ title, copy, actionLabel, onAction }: EmptyStateProps) {
|
||||
return (
|
||||
<div className="empty-state">
|
||||
<div className="empty-state-icon">
|
||||
<Zap size={22} aria-hidden="true" />
|
||||
</div>
|
||||
<h3 className="empty-state-title">{title}</h3>
|
||||
<p className="empty-state-copy mt-2 max-w-sm">{copy}</p>
|
||||
{actionLabel && onAction && (
|
||||
<button className="primary-button mt-4" type="button" onClick={onAction}>
|
||||
<Plus size={17} aria-hidden="true" />
|
||||
{actionLabel}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user