mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-08 22:22:17 +02:00
- Introduced a comprehensive specification for renaming `searchSpace` to `workspace` in `surfsense_web` and `surfsense_desktop`, ensuring all TypeScript identifiers, React props, and local data structures are updated. - Implemented migration shims for persisted local state to prevent data loss during the transition. - Updated observability metrics and IPC channels to reflect the new naming convention. - Removed legacy `active-search-space` module and replaced it with `active-workspace` to maintain consistency. - Ensured no behavioral changes or data loss for users during the renaming process.
24 lines
722 B
TypeScript
24 lines
722 B
TypeScript
"use client";
|
|
import { useAtomValue } from "jotai";
|
|
import { automationsListAtom } from "@/atoms/automations/automations-query.atoms";
|
|
|
|
/**
|
|
* List automations in the active workspace (first page).
|
|
* Pagination knobs live in detail/list hooks below; v1 surfaces only the
|
|
* first page since automation counts are expected to be small.
|
|
*/
|
|
export function useAutomations() {
|
|
const { data, isLoading, error, refetch } = useAutomationsRaw();
|
|
return {
|
|
automations: data?.items ?? [],
|
|
total: data?.total ?? 0,
|
|
loading: isLoading,
|
|
error,
|
|
refresh: refetch,
|
|
};
|
|
}
|
|
|
|
// Exposed for callers that prefer the raw react-query result shape.
|
|
export function useAutomationsRaw() {
|
|
return useAtomValue(automationsListAtom);
|
|
}
|