import { UserProfile } from "." import { USER_INFO } from "./config" export const saveUserCredential = (data: string) => { if (data) { localStorage.setItem(USER_INFO, data) } } export const loadUserCredential = (): UserProfile | null => { const data = localStorage.getItem(USER_INFO) if (data) { const userObj: UserProfile = JSON.parse(data) return userObj } return null }