Back
Version 71
12/14/2024
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import { ClipboardDocumentCheckIcon } from "https://esm.sh/@heroicons/react/24/outline";
import { ClipboardIcon, MoonIcon, SunIcon, XMarkIcon } from "https://esm.sh/@heroicons/react/24/solid";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
function App() {
const [url, setUrl] = useState(() => {
// Initialize URL from localStorage on first load
return localStorage.getItem("lastUsedUrl") || "";
});
const [summary, setSummary] = useState("");
const [isLoading, setIsLoading] = useState(false);
const [isCopied, setIsCopied] = useState(false);
const [isDarkMode, setIsDarkMode] = useState(() => {
// Check localStorage for theme preference or default to system preference
const savedTheme = localStorage.getItem("theme");
if (savedTheme) return savedTheme === "dark";
return window.matchMedia("(prefers-color-scheme: dark)").matches;
});
// Example URLs
const exampleUrls = [
"https://arxiv.org/abs/2411.07279",
"https://www.anthropic.com/news/github-copilot",
"https://huggingface.co/papers/2403.09629",
"https://arxiv.org/abs/2305.20050",
];
// Update localStorage whenever URL changes
useEffect(() => {
if (url) {
localStorage.setItem("lastUsedUrl", url);
}
}, [url]);
spinningideas-webpage_summarizer.web.val.run
Updated: December 14, 2024