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:
nh9961
2026-07-19 19:31:40 +00:00
parent 2cd8dd5130
commit 50c729eae7
34 changed files with 2312 additions and 2218 deletions
+26
View File
@@ -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>
);
}