Skip to main content

Function: useSelectedSite()

useSelectedSite(): undefined | Site

Defined in: src/hooks/useSelectedSite.ts:51

Hook to get the currently selected site from coordinated store data.

Returnsโ€‹

undefined | Site

The selected site object or undefined if no selection exists

Remarksโ€‹

This hook efficiently combines data from the UI store (selection state) and sites store (site data) using useMemo to prevent unnecessary recalculations. The memoization ensures the hook only recalculates when the selected site ID or sites array actually changes.