Back

Version 28

11/18/2024
/** @jsxImportSource https://esm.sh/react */
import React, { useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
import ReactMarkdown from "https://esm.sh/react-markdown";
import remarkGfm from "https://esm.sh/remark-gfm";
import rehypeRaw from "https://esm.sh/rehype-raw";

function ProgressBar({ progress }) {
return (
<div className="w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700 mb-4">
<div
className="bg-orange-600 h-2.5 rounded-full transition-all duration-500 ease-in-out"
style={{ width: `${progress}%` }}
></div>
</div>
);
}

function App() {
const [postId, setPostId] = useState("");
const [summary, setSummary] = useState("");
const [loading, setLoading] = useState(false);
const [error, setError] = useState("");
const [progress, setProgress] = useState(0);

const fetchAndSummarize = async () => {
if (!postId) {
setError("Please enter a valid Hacker News post ID");
return;
}

setLoading(true);
setError("");
setSummary("");
setProgress(10); // Initial progress

prashamtrivedi-summarizehn.web.val.run
Updated: December 17, 2024