setConfirmDeleteOpen(false)}
+ onConfirm={() => isBulkDelete ? executeDeleteChannels() : executeDeleteChannel(deleteTarget)}
+ title={`Confirm ${isBulkDelete ? 'Bulk ' : ''}Channel Deletion`}
+ message={
+ isBulkDelete
+ ? `Are you sure you want to delete ${table.selectedTableIds.length} channels? This action cannot be undone.`
+ : channelToDelete
+ ?
+ {`Are you sure you want to delete the following channel?
+
+Name: ${channelToDelete.name}
+Channel Number: ${channelToDelete.channel_number}
+
+This action cannot be undone.`}
+
+ : "Are you sure you want to delete this channel? This action cannot be undone."
+ }
+ confirmLabel="Delete"
+ cancelLabel="Cancel"
+ actionKey={isBulkDelete ? 'delete-channels' : 'delete-channel'}
+ onSuppressChange={suppressWarning}
+ size="md"
/>
-
+ >
);
};
diff --git a/frontend/src/store/warnings.jsx b/frontend/src/store/warnings.jsx
new file mode 100644
index 00000000..3a57b21f
--- /dev/null
+++ b/frontend/src/store/warnings.jsx
@@ -0,0 +1,29 @@
+import { create } from 'zustand';
+
+const useWarningsStore = create((set) => ({
+ // Map of action keys to whether they're suppressed
+ suppressedWarnings: {},
+
+ // Function to check if a warning is suppressed
+ isWarningSuppressed: (actionKey) => {
+ const state = useWarningsStore.getState();
+ return state.suppressedWarnings[actionKey] === true;
+ },
+
+ // Function to suppress a warning
+ suppressWarning: (actionKey, suppressed = true) => {
+ set((state) => ({
+ suppressedWarnings: {
+ ...state.suppressedWarnings,
+ [actionKey]: suppressed
+ }
+ }));
+ },
+
+ // Function to reset all suppressions
+ resetSuppressions: () => {
+ set({ suppressedWarnings: {} });
+ }
+}));
+
+export default useWarningsStore;