// utils/consultationStorage.js
export const consultationStorage = {
  setSubmitted: () => {
    localStorage.setItem('consultationSubmittedAt', Date.now().toString());
  },
  
  hasRecentSubmission: () => {
    if (typeof window === 'undefined') return false;
    
    const submittedAt = localStorage.getItem('consultationSubmittedAt');
    if (!submittedAt) return false;
    
    const threeDaysInMs = 3 * 24 * 60 * 60 * 1000;
    return (Date.now() - parseInt(submittedAt)) < threeDaysInMs;
  },
  
  clearSubmission: () => {
    localStorage.removeItem('consultationSubmittedAt');
  },
  
  getSubmissionDate: () => {
    return localStorage.getItem('consultationSubmittedAt');
  }
};