From 61bc27471510cba3a4502821e448ea206bb69f42 Mon Sep 17 00:00:00 2001 From: Lukas Date: Sat, 14 Mar 2026 11:57:03 +0100 Subject: [PATCH] Extract BulkImportToasts component from App.tsx Co-Authored-By: Claude Opus 4.6 --- apps/web/src/App.tsx | 33 +++---------- .../web/src/components/bulk-import-toasts.tsx | 49 +++++++++++++++++++ 2 files changed, 55 insertions(+), 27 deletions(-) create mode 100644 apps/web/src/components/bulk-import-toasts.tsx diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index 87223b1..c7e2243 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -16,6 +16,7 @@ import { useState, } from "react"; import { ActionBar } from "./components/action-bar"; +import { BulkImportToasts } from "./components/bulk-import-toasts"; import { CombatantRow } from "./components/combatant-row"; import { PlayerCharacterSection, @@ -368,33 +369,11 @@ export function App() { sourceManagerMode={sidePanel.sourceManagerMode} /> - {/* Toast for bulk import progress when panel is closed */} - {bulkImport.state.status === "loading" && !sidePanel.bulkImportMode && ( - 0 - ? (bulkImport.state.completed + bulkImport.state.failed) / - bulkImport.state.total - : 0 - } - onDismiss={() => {}} - /> - )} - {bulkImport.state.status === "complete" && !sidePanel.bulkImportMode && ( - - )} - {bulkImport.state.status === "partial-failure" && - !sidePanel.bulkImportMode && ( - - )} + {rollSkippedCount > 0 && ( void; +} + +export function BulkImportToasts({ + state, + visible, + onReset, +}: BulkImportToastsProps) { + if (!visible) return null; + + if (state.status === "loading") { + return ( + 0 ? (state.completed + state.failed) / state.total : 0 + } + onDismiss={() => {}} + /> + ); + } + + if (state.status === "complete") { + return ( + + ); + } + + if (state.status === "partial-failure") { + return ( + + ); + } + + return null; +}