import { Mulberry32 } from "../utils.js"; import React, { useState, useEffect } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faChevronRight, faChevronDown, } from "@fortawesome/free-solid-svg-icons"; export function Dashboard({ isRecording, onRecord, transcriptionText, finalSummary, topics, stream, }) { const [openIndex, setOpenIndex] = useState(null); const [autoscrollEnabled, setAutoscrollEnabled] = useState(true); useEffect(() => { if (autoscrollEnabled) scrollToBottom(); }, [topics.length]); const scrollToBottom = () => { const topicsDiv = document.getElementById("topics-div"); topicsDiv.scrollTop = topicsDiv.scrollHeight; }; const handleScroll = (e) => { const bottom = e.target.scrollHeight - e.target.scrollTop === e.target.clientHeight; if (!bottom && autoscrollEnabled) { setAutoscrollEnabled(false); } else if (bottom && !autoscrollEnabled) { setAutoscrollEnabled(true); } }; return ( <>
Duration: {finalSummary.duration}
{finalSummary.summary}