fix(dashboard): type the reorder hook's notifier explicitly (dashboard-typecheck TS2339)

ReturnType<typeof useNotificationStore> resolves to unknown under the
dashboard-scoped tsconfig gate (#7203), so notify.error tripped TS2339.
The hook only needs error(), so declare that minimal surface directly.
This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-07-15 11:24:55 -03:00
parent 42f1699245
commit 1c3223dd30

View File

@@ -18,9 +18,11 @@
import { useState } from "react";
import { sortConnectionsByAvailability } from "../components/connectionRowHelpers";
import type { ConnectionRowConnection } from "../components/ConnectionRow";
import { useNotificationStore } from "@/store/notificationStore";
type NotifyStore = ReturnType<typeof useNotificationStore>;
/** Minimal surface of the notification store this hook needs. */
interface ReorderNotifier {
error: (message: string) => void;
}
export interface UseReorderByAvailabilityParams {
connections: ConnectionRowConnection[];
@@ -30,7 +32,7 @@ export interface UseReorderByAvailabilityParams {
| ((prev: ConnectionRowConnection[]) => ConnectionRowConnection[])
) => void;
fetchConnections: () => Promise<void>;
notify: NotifyStore;
notify: ReorderNotifier;
t: (key: string, params?: Record<string, unknown>) => string;
}