const STORAGE_KEY = "first_access_data";

export const setFirstAccessData = (payload) => {
  sessionStorage.setItem(STORAGE_KEY, JSON.stringify(payload));
};

export const getFirstAccessData = () => {
  const raw = sessionStorage.getItem(STORAGE_KEY);
  if (!raw) return null;
  try {
    return JSON.parse(raw);
  } catch {
    return null;
  }
};

export const clearFirstAccessData = () => {
  sessionStorage.removeItem(STORAGE_KEY);
};
