Add Hard Refresh button to TopBar

Button triggers reload of all data from Dropbox source
This commit is contained in:
Christian Vidal Wolf
2026-04-20 20:30:21 +02:00
parent 369e37c8f5
commit ecf1c7831c
2 changed files with 16 additions and 2 deletions
+13 -1
View File
@@ -6,6 +6,7 @@ interface TopBarProps {
stats: any;
activeModule?: string;
onExport: () => void;
onRefresh?: () => void;
hasData: boolean;
hasUnsavedChanges: boolean;
userEmail?: string;
@@ -21,7 +22,7 @@ interface TopBarProps {
isSavingAll: boolean;
}
export function TopBar({ stats, activeModule, onExport, hasData, hasUnsavedChanges, userEmail, onSignOut, canUndo, onUndo, undoMessage, undoSteps, pendingCount, pendingChanges, onSaveAll, onRevertRow, isSavingAll }: TopBarProps) {
export function TopBar({ stats, activeModule, onExport, onRefresh, hasData, hasUnsavedChanges, userEmail, onSignOut, canUndo, onUndo, undoMessage, undoSteps, pendingCount, pendingChanges, onSaveAll, onRevertRow, isSavingAll }: TopBarProps) {
const [showPending, setShowPending] = useState(false);
const dropdownRef = useRef<HTMLDivElement>(null);
@@ -167,6 +168,17 @@ export function TopBar({ stats, activeModule, onExport, hasData, hasUnsavedChang
</button>
)}
{onRefresh && (
<button
onClick={onRefresh}
className="flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium bg-violet-600 hover:bg-violet-700 text-white transition-colors"
title="Hard Refresh - Reload all data from source"
>
<RotateCcw className="w-4 h-4" />
Refresh
</button>
)}
<button
onClick={onUndo}
disabled={!canUndo}