import { useLocalStorage } from "react-use"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog"; import { useUser } from "@/hooks/useUser"; import { isTheSameHtml } from "@/lib/compare-html-diff"; import { Page } from "@/types"; export const LoginModal = ({ open, pages, onClose, title = "Log In to use DeepSite for free", description = "Log In through your Hugging Face account to continue using DeepSite and increase your monthly free limit.", }: { open: boolean; pages?: Page[]; onClose: React.Dispatch>; title?: string; description?: string; }) => { const { openLoginWindow } = useUser(); const [, setStorage] = useLocalStorage("pages"); const handleClick = async () => { if (pages && !isTheSameHtml(pages[0].html)) { setStorage(pages); } openLoginWindow(); onClose(false); }; return (
💪
😎
🙌

{title}

{description}

); };