File size: 697 Bytes
			
			| d1d23d8 436a8e5 d1d23d8 436a8e5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | // Client-side storage utilities
const isClient = typeof window !== 'undefined' && typeof localStorage !== 'undefined';
export function getLocalStorage(key: string): any | null {
  if (!isClient) {
    return null;
  }
  try {
    const item = localStorage.getItem(key);
    return item ? JSON.parse(item) : null;
  } catch (error) {
    console.error(`Error reading from localStorage key "${key}":`, error);
    return null;
  }
}
export function setLocalStorage(key: string, value: any): void {
  if (!isClient) {
    return;
  }
  try {
    localStorage.setItem(key, JSON.stringify(value));
  } catch (error) {
    console.error(`Error writing to localStorage key "${key}":`, error);
  }
}
 | 
