import Cookies from "js-cookie"; export function getUserInfo(): T | null { const raw = Cookies.get("userInfo"); if (!raw) return null; try { return JSON.parse(raw) as T; } catch (err) { console.error("Failed to parse userInfo cookie:", err); return null; } }