import "server-only"; import { cookies } from "next/headers"; import { LOCATION_COOKIE_NAME, type LocationState } from "./types"; export async function getLocationServer(): Promise { const store = await cookies(); const value = store.get(LOCATION_COOKIE_NAME)?.value; if (!value) return null; try { return JSON.parse(value) as LocationState; } catch { return null; } }