/**
 * Canvas Cache Utilities
 */

export const canvasCache = {
  get: (key: string) => {
    try {
      const item = localStorage.getItem(`canvas_${key}`);
      return item ? JSON.parse(item) : null;
    } catch { return null; }
  },
  set: (key: string, value: any) => {
    try {
      localStorage.setItem(`canvas_${key}`, JSON.stringify(value));
    } catch {}
  },
  clear: (key: string) => {
    try {
      localStorage.removeItem(`canvas_${key}`);
    } catch {}
  },
};
