import { UserType } from "@/package-shared/types"; import React from "react"; export default function useLocalUser() { const [user, setUser] = React.useState(); React.useEffect(() => { try { const localUserJSON = localStorage.getItem("user"); setUser(JSON.parse(localUserJSON || "")); } catch (error) {} }, []); return { user }; }