2026-02-02 20:34:35 +00:00
|
|
|
/**
|
2026-07-14 22:34:20 +01:00
|
|
|
* Custom hook for managing school comparison state.
|
|
|
|
|
*
|
|
|
|
|
* This hook is mounted on every page via the global Navigation and
|
|
|
|
|
* ComparisonToast, so it must stay cheap — it exposes basket state only.
|
|
|
|
|
* The compare page fetches `/api/compare` itself (ComparisonView); nothing
|
|
|
|
|
* ever read the comparison payload from here, so the previous per-page SWR
|
|
|
|
|
* fetch (which fired on every page whenever the basket was non-empty) was
|
|
|
|
|
* dead weight and has been removed.
|
2026-02-02 20:34:35 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
'use client';
|
|
|
|
|
|
2026-02-03 14:26:23 +00:00
|
|
|
import { useComparisonContext } from '@/context/ComparisonContext';
|
2026-02-02 20:34:35 +00:00
|
|
|
|
|
|
|
|
export function useComparison() {
|
2026-07-14 22:34:20 +01:00
|
|
|
return useComparisonContext();
|
2026-02-02 20:34:35 +00:00
|
|
|
}
|