(null);
const [isFormSubmitting, setIsFormSubmitting] = React.useState(false);
+ const handleTopUp = React.useCallback(
+ (s: Stream) => setModal({ type: "topup", stream: s }),
+ [],
+ );
+ const handleCancel = React.useCallback(
+ (s: Stream) => setModal({ type: "cancel", stream: s }),
+ [],
+ );
+ const handleShowDetails = React.useCallback(
+ (s: Stream) => setModal({ type: "details", stream: s }),
+ [],
+ );
+ const handleShowWizard = React.useCallback(
+ () => setShowWizard(true),
+ [],
+ );
+
const safeLoadTemplates = (): StreamTemplate[] => {
try {
if (typeof window === "undefined") return [];
@@ -988,13 +1013,13 @@ export function DashboardView({ session, onDisconnect }: DashboardViewProps) {
{renderStats(snapshot)}
{renderAnalytics(snapshot)}
- {renderStreams(
- snapshot,
- (s) => setModal({ type: "topup", stream: s }),
- (s) => setModal({ type: "cancel", stream: s }),
- (s) => setModal({ type: "details", stream: s }),
- )}
- {renderRecentActivity(snapshot, () => setShowWizard(true))}
+
+
);
}
@@ -1042,12 +1067,12 @@ export function DashboardView({ session, onDisconnect }: DashboardViewProps) {
}
return (
- {renderStreams(
- { ...snapshot!, outgoingStreams: activeOutgoing },
- (s) => setModal({ type: "topup", stream: s }),
- (s) => setModal({ type: "cancel", stream: s }),
- (s) => setModal({ type: "details", stream: s }),
- )}
+
);
}
@@ -1099,7 +1124,7 @@ export function DashboardView({ session, onDisconnect }: DashboardViewProps) {
if (activeTab === "activity") {
return (
- {renderRecentActivity(snapshot, () => setShowWizard(true))}
+
);
}