import type { BentoSelection } from "@ben-to/builder/domain";

const key = "ben-to.selection";

export const saveSelection = (selection: BentoSelection): void => {
  localStorage.setItem(key, JSON.stringify(selection));
};

export const loadSelection = (): BentoSelection | null => {
  const raw = localStorage.getItem(key);
  return raw ? (JSON.parse(raw) as BentoSelection) : null;
};
